Fix bug when taking seat with full inventory.
This commit is contained in:
parent
60e9e70c3d
commit
3fa340f94e
@ -102,7 +102,10 @@ end
|
|||||||
function chair_entity:on_punch(puncher)
|
function chair_entity:on_punch(puncher)
|
||||||
if self.driver==nil then
|
if self.driver==nil then
|
||||||
local inv = puncher:get_inventory()
|
local inv = puncher:get_inventory()
|
||||||
inv:add_item("main", ItemStack("chair_lift:seat"))
|
local noadd = inv:add_item("main", ItemStack("chair_lift:seat"))
|
||||||
|
if noadd:get_count()>0 then
|
||||||
|
minetest.add_item(puncher:get_pos(), noadd)
|
||||||
|
end
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user