Fix players not dropping items on losing arms

This commit is contained in:
Aaron Suen 2020-06-30 07:14:34 -04:00
parent e86545f5e7
commit cf799989b3

View File

@ -1,22 +1,12 @@
-- LUALOCALS < ---------------------------------------------------------
local nodecore, pairs
= nodecore, pairs
local nodecore
= nodecore
-- LUALOCALS > ---------------------------------------------------------
nodecore.register_playerstep({
label = "inventory requires interact",
action = function(player, data)
action = function(player)
if nodecore.interact(player) then return end
local pos = player:get_pos()
pos.y = pos.y + data.properties.eye_height
local inv = player:get_inventory()
for i, stack in pairs(inv:get_list("main")) do
if not stack:is_empty() then
if nodecore.item_is_virtual(stack) then
nodecore.item_eject(pos, stack, 0.001)
inv:set_stack("main", i, "")
end
end
end
return nodecore.inventory_dump(player)
end
})