From 666eed09d94cf3bd04ae7536548b0f0638682f97 Mon Sep 17 00:00:00 2001 From: Harag Date: Thu, 31 Oct 2024 00:34:56 +0100 Subject: [PATCH] removed train needs cleanup in available trains --- cybersyn/scripts/central-planning.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cybersyn/scripts/central-planning.lua b/cybersyn/scripts/central-planning.lua index fae458d3..89cc09ab 100644 --- a/cybersyn/scripts/central-planning.lua +++ b/cybersyn/scripts/central-planning.lua @@ -524,6 +524,11 @@ local function tick_dispatch(map_data, mod_settings) if trains then for train_id, _ in pairs(trains) do local train = map_data.trains[train_id] + if not train then + -- removed train needs cleanup in available_trains + trains[train_id] = nil + goto train_continue + end -- Check if train is on same Cybersyn network. local train_flag = get_network_mask(train, network_name)