Skip to content

Commit

Permalink
Merge pull request #191 from harag-on-steam/bugfix/clean-available-tr…
Browse files Browse the repository at this point in the history
…ains

Removed trains need cleanup in available_trains
  • Loading branch information
Tetlanesh authored Nov 4, 2024
2 parents 8b46aa8 + 666eed0 commit 75b987a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cybersyn/scripts/central-planning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 75b987a

Please sign in to comment.