Slight reorder to prevent race condition in hopper item collection

This commit is contained in:
wallabra 2022-02-17 21:34:01 -03:00
parent 0c6da14e1f
commit 2c8194bd6d
Signed by untrusted user: Gustavo6046
GPG Key ID: 5182FABAA5E139B3
1 changed files with 1 additions and 1 deletions

View File

@ -359,10 +359,10 @@ minetest.register_abm({
local posob = object:get_pos()
local posob_miny = posob.y + object:get_properties().collisionbox[2]
if math.abs(posob.x-pos.x) <= 0.5 and (posob_miny-pos.y < 1.5 and posob.y-pos.y >= 0.3) then
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
entity._removed = true
entity.itemstring = ""
object:remove()
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
end
end
end