prepared to add depot bypass

This commit is contained in:
Monica Moniot
2022-11-30 23:29:46 -05:00
parent 24b00b9f3e
commit ac09811324
8 changed files with 101 additions and 66 deletions

View File

@@ -55,9 +55,11 @@ end
---@param train Train
---@param train_id uint
function remove_train(map_data, train, train_id)
if train.status == STATUS_D then
local depot = map_data.depots[train.depot_id]
remove_available_train(map_data, train, depot)
local parked_at_depot_id = train.depot_id
if parked_at_depot_id then
local depot = map_data.depots[parked_at_depot_id]
remove_available_train(map_data, parked_at_depot_id, train)
depot.available_train_id = nil
end
local layout_id = train.layout_id
local count = map_data.layout_train_count[layout_id]