fixed a crash relating to space elevators

This commit is contained in:
Monica Moniot
2022-12-01 14:18:13 -05:00
parent 44d2d043e7
commit 5ea40971f1
3 changed files with 30 additions and 1 deletions

View File

@@ -998,6 +998,14 @@ local function main()
local train = map_data.trains[old_id]
if not train then return end
if train.is_available then
local network = map_data.available_trains[train.network_name--[[@as string]]]
if network then
network[new_id] = true
network[old_id] = nil
end
end
map_data.trains[new_id] = train
map_data.trains[old_id] = nil
train.entity = train_entity