From cbeedc3cceeb21a2033bcf857343be86ece7b8e7 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Sun, 17 Sep 2023 17:14:31 +0200 Subject: [PATCH] Mtn v3 - fix minor bug --- maps/mountain_fortress_v3/icw/linked_chests.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/maps/mountain_fortress_v3/icw/linked_chests.lua b/maps/mountain_fortress_v3/icw/linked_chests.lua index ad7d8419..d521ce5e 100644 --- a/maps/mountain_fortress_v3/icw/linked_chests.lua +++ b/maps/mountain_fortress_v3/icw/linked_chests.lua @@ -985,9 +985,10 @@ Event.on_nth_tick( 120, function() local containers = this.main_containers - local loco_surface = WPT.get('loco_surface') + local active_surface_index = WPT.get('active_surface_index') + for index, container in pairs(containers) do - if container and container.chest and container.chest.valid and container.chest.surface.index ~= loco_surface.index then + if container and container.chest and container.chest.valid and container.chest.surface.index == active_surface_index then if not WPT.locomotive.is_around_train(container.chest) then remove_chest(container.unit_number) end