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
1 changed files with 6 additions and 5 deletions

View File

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