forked from luanti-org/minetest_game
		
	Use creative.is_enabled_for for creative mode if possible (#1558)
This commit is contained in:
		| @@ -110,7 +110,8 @@ function boat.on_punch(self, puncher) | ||||
| 	if not self.driver then | ||||
| 		self.removed = true | ||||
| 		local inv = puncher:get_inventory() | ||||
| 		if not minetest.setting_getbool("creative_mode") | ||||
| 		if not (creative and creative.is_enabled_for | ||||
| 				and creative.is_enabled_for(puncher:get_player_name())) | ||||
| 				or not inv:contains_item("main", "boats:boat") then | ||||
| 			local leftover = inv:add_item("main", "boats:boat") | ||||
| 			-- if no room in inventory add a replacement boat to the world | ||||
| @@ -244,7 +245,8 @@ minetest.register_craftitem("boats:boat", { | ||||
| 		boat = minetest.add_entity(pointed_thing.under, "boats:boat") | ||||
| 		if boat then | ||||
| 			boat:setyaw(placer:get_look_horizontal()) | ||||
| 			if not minetest.setting_getbool("creative_mode") then | ||||
| 			if not (creative and creative.is_enabled_for | ||||
| 					and creative.is_enabled_for(placer:get_player_name())) then | ||||
| 				itemstack:take_item() | ||||
| 			end | ||||
| 		end | ||||
|   | ||||
		Reference in New Issue
	
	Block a user