1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2024-10-07 03:30:33 +02:00

resolve player object in async function again (different globalstep)

fixes #132
This commit is contained in:
BuckarooBanzay 2024-01-15 10:15:49 +01:00
parent 467709c935
commit f430395b64

View File

@ -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)