From 97158f7facf9f15ff609c241a520633986b0f31d Mon Sep 17 00:00:00 2001 From: HybridDog Date: Tue, 5 Feb 2019 19:29:40 +0100 Subject: [PATCH] Ignore items where picking failed tested with item_helpers --- init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.lua b/init.lua index 6d8db5d..e437f34 100644 --- a/init.lua +++ b/init.lua @@ -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, }