From 6549ad7c12b639b90d424133b27abe7cb9501097 Mon Sep 17 00:00:00 2001 From: Lynn Date: Mon, 10 Dec 2018 22:09:21 +0100 Subject: [PATCH] Autoloot coins in diggy that are dropped --- map_gen/Diggy/Feature/CoinGathering.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/map_gen/Diggy/Feature/CoinGathering.lua b/map_gen/Diggy/Feature/CoinGathering.lua index 993b3e97..8071bda0 100644 --- a/map_gen/Diggy/Feature/CoinGathering.lua +++ b/map_gen/Diggy/Feature/CoinGathering.lua @@ -161,11 +161,15 @@ function CoinGathering.register(config) ceil(5 * evolution_multiplier * modifier) ) - entity.surface.create_entity({ + local coin = entity.surface.create_entity({ name = 'item-on-ground', position = entity.position, stack = {name = 'coin', count = count} }) + + if coin and coin.valid then + coin.to_be_looted = true + end end) local mining_coin_chance = config.mining_coin_chance @@ -181,11 +185,15 @@ function CoinGathering.register(config) return end - entity.surface.create_entity({ + local coin = entity.surface.create_entity({ name = 'item-on-ground', position = entity.position, stack = {name = 'coin', count = random(mining_coin_amount_min, mining_coin_amount_max)} }) + + if coin and coin.valid then + coin.to_be_looted = true + end end) if config.display_chest_locations then