mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 18:08:13 -06:00
fixed a crash relating to space elevators
This commit is contained in:
@@ -41,7 +41,7 @@ cybersyn-request-threshold=Request threshold
|
|||||||
cybersyn-locked-slots=Locked slots per cargo wagon
|
cybersyn-locked-slots=Locked slots per cargo wagon
|
||||||
|
|
||||||
[cybersyn-messages]
|
[cybersyn-messages]
|
||||||
missing-trains=No trains available to make a delivery from __2__ to __1__
|
missing-trains=Could not find a train to make a delivery from __2__ to __1__
|
||||||
lost-train=A train from depot __1__ has become lost
|
lost-train=A train from depot __1__ has become lost
|
||||||
nonempty-train=A train is being held in the depot because it still has cargo
|
nonempty-train=A train is being held in the depot because it still has cargo
|
||||||
unexpected-train=A train has unexpectedly returned to the depot before completing its delivery
|
unexpected-train=A train has unexpectedly returned to the depot before completing its delivery
|
||||||
|
|||||||
@@ -998,6 +998,14 @@ local function main()
|
|||||||
local train = map_data.trains[old_id]
|
local train = map_data.trains[old_id]
|
||||||
if not train then return end
|
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[new_id] = train
|
||||||
map_data.trains[old_id] = nil
|
map_data.trains[old_id] = nil
|
||||||
train.entity = train_entity
|
train.entity = train_entity
|
||||||
|
|||||||
@@ -142,6 +142,27 @@ local migrations_table = {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
["1.0.7"] = function()
|
||||||
|
---@type MapData
|
||||||
|
local map_data = global
|
||||||
|
map_data.tick_state = STATE_INIT
|
||||||
|
map_data.tick_data = {}
|
||||||
|
if IS_SE_PRESENT then
|
||||||
|
for k, v in pairs(map_data.available_trains) do
|
||||||
|
for id, _ in pairs(v) do
|
||||||
|
local train = map_data.trains[id]
|
||||||
|
if not train then
|
||||||
|
v[id] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for id, v in pairs(map_data.trains) do
|
||||||
|
if v.is_available then
|
||||||
|
map_data.available_trains[v.network_name--[[@as string]]][id] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
---@param data ConfigurationChangedData
|
---@param data ConfigurationChangedData
|
||||||
|
|||||||
Reference in New Issue
Block a user