mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
Fix crash when boat is punched by non-player
This commit is contained in:
parent
754b93026b
commit
be145ea22e
1 changed files with 2 additions and 2 deletions
|
@ -59,13 +59,13 @@ function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, d
|
||||||
if self._driver then
|
if self._driver then
|
||||||
self._driver:set_detach()
|
self._driver:set_detach()
|
||||||
self._driver = nil
|
self._driver = nil
|
||||||
if 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", "mcl_boats:boat")
|
puncher:get_inventory():add_item("main", "mcl_boats:boat")
|
||||||
end
|
end
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
else
|
else
|
||||||
|
|
||||||
if 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", "mcl_boats:boat")
|
puncher:get_inventory():add_item("main", "mcl_boats:boat")
|
||||||
end
|
end
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
|
|
Loading…
Reference in a new issue