Ignore items where picking failed

tested with item_helpers
This commit is contained in:
HybridDog 2019-02-05 19:29:40 +01:00
parent 8e1878d101
commit 726b5f4872

@ -8,6 +8,10 @@ item_drop = {
-- It is also executed before collecting the item after it flew to
-- the player and did not reach him/her for magnet_time seconds.
can_pickup = function(entity, player)
if entity.item_drop_picked then
-- Ignore items where picking has already failed
return false
end
return true
end,
@ -16,6 +20,7 @@ item_drop = {
before_collect = function(entity, pos, player)
end,
after_collect = function(entity, pos, player)
entity.item_drop_picked = true
end,
}