forked from MineClone5/MineClone5
Slight reorder to prevent race condition in hopper item collection
This commit is contained in:
parent
0c6da14e1f
commit
2c8194bd6d
|
@ -359,10 +359,10 @@ minetest.register_abm({
|
||||||
local posob = object:get_pos()
|
local posob = object:get_pos()
|
||||||
local posob_miny = posob.y + object:get_properties().collisionbox[2]
|
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
|
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._removed = true
|
||||||
entity.itemstring = ""
|
entity.itemstring = ""
|
||||||
object:remove()
|
object:remove()
|
||||||
|
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue