From cf799989b3d3fc4a4a55aed911ad0f4ed97e9804 Mon Sep 17 00:00:00 2001 From: Aaron Suen Date: Tue, 30 Jun 2020 07:14:34 -0400 Subject: [PATCH] Fix players not dropping items on losing arms --- mods/nc_player_setup/step_interactinv.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/mods/nc_player_setup/step_interactinv.lua b/mods/nc_player_setup/step_interactinv.lua index f341a1e5..c1c3d06b 100644 --- a/mods/nc_player_setup/step_interactinv.lua +++ b/mods/nc_player_setup/step_interactinv.lua @@ -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 })