forked from mtcontrib/3d_armor
resolve player object in async function again (different globalstep)
fixes #132
This commit is contained in:
parent
467709c935
commit
f430395b64
|
@ -719,6 +719,8 @@ armor.unequip = function(self, player, armor_element)
|
|||
if self:get_element(stack:get_name()) == armor_element then
|
||||
armor_inv:set_stack("armor", i, "")
|
||||
minetest.after(0, function()
|
||||
-- resolve player object again in async function
|
||||
player = minetest.get_player_by_name(name)
|
||||
local inv = player:get_inventory()
|
||||
if inv:room_for_item("main", stack) then
|
||||
inv:add_item("main", stack)
|
||||
|
|
Loading…
Reference in New Issue
Block a user