From e68f6553a908fa33803e8ad19eab772fa9e2a0da Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Fri, 11 Nov 2022 11:21:23 -0500 Subject: [PATCH] fixed bug --- cybersyn/scripts/central-planning.lua | 4 +++- cybersyn/scripts/gui.lua | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cybersyn/scripts/central-planning.lua b/cybersyn/scripts/central-planning.lua index 6845e4a..195ff54 100644 --- a/cybersyn/scripts/central-planning.lua +++ b/cybersyn/scripts/central-planning.lua @@ -246,6 +246,8 @@ function poll_depot(map_data, depot) end end end + else + depot.network_flag = 0 end end @@ -363,7 +365,7 @@ local function tick_dispatch(map_data, mod_settings) local r_stations = tick_data.r_stations local p_stations = tick_data.p_stations - if not p_stations then + if p_stations == nil or #p_stations == 0 or #r_stations == 0 then while true do local size = #all_names if size == 0 then diff --git a/cybersyn/scripts/gui.lua b/cybersyn/scripts/gui.lua index d3df6e3..e6afbb4 100644 --- a/cybersyn/scripts/gui.lua +++ b/cybersyn/scripts/gui.lua @@ -222,7 +222,7 @@ function register_gui_actions() local a = comb.get_or_create_control_behavior()--[[@as LuaArithmeticCombinatorControlBehavior]] - local allows_all_trains = element.state + local allows_all_trains = not element.state set_comb_allows_all_trains(a, allows_all_trains) local stop = global.to_stop[comb.unit_number]