Skip to content
Snippets Groups Projects
Commit f3dc7820 authored by paramat's avatar paramat
Browse files

Boats: Check inventory in boat.on_punch

If puncher inventory is full, then drop boat
parent b292975f
No related branches found
No related tags found
No related merge requests found
......@@ -105,7 +105,12 @@ function boat.on_punch(self, puncher, time_from_last_punch,
self.object:remove()
end)
if not minetest.setting_getbool("creative_mode") then
puncher:get_inventory():add_item("main", "boats:boat")
local inv = puncher:get_inventory()
if inv:room_for_item("main", "boats:boat") then
inv:add_item("main", "boats:boat")
else
minetest.add_item(self.object:getpos(), "boats:boat")
end
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment