Ignore items where picking failed

tested with item_helpers
This commit is contained in:
HybridDog 2019-02-05 19:29:40 +01:00
parent dd01ddf5ff
commit 97158f7fac
1 changed files with 5 additions and 0 deletions

View File

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