Fix crash in boats mod

This commit is contained in:
sfan5 2014-07-06 09:53:54 +02:00 committed by BlockMen
parent 7e5dc6c374
commit 46b6cee1fc

View File

@ -76,6 +76,7 @@ function boat:get_staticdata()
end end
function boat:on_punch(puncher, time_from_last_punch, tool_capabilities, direction) function boat:on_punch(puncher, time_from_last_punch, tool_capabilities, direction)
puncher:set_detach()
self.object:remove() self.object:remove()
if puncher and puncher:is_player() and not minetest.setting_getbool("creative_mode") then if puncher and puncher:is_player() and not minetest.setting_getbool("creative_mode") then
puncher:get_inventory():add_item("main", "boats:boat") puncher:get_inventory():add_item("main", "boats:boat")