mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-11 08:08:15 -06:00
fixed a crash
This commit is contained in:
@@ -695,13 +695,15 @@ local function on_train_built(event)
|
|||||||
end
|
end
|
||||||
local function on_train_changed(event)
|
local function on_train_changed(event)
|
||||||
local train_e = event.train
|
local train_e = event.train
|
||||||
local train = global.trains[train_e.id]
|
|
||||||
if train_e.valid then
|
if train_e.valid then
|
||||||
|
local train = global.trains[train_e.id]
|
||||||
if train_e.state == defines.train_state.wait_station then
|
if train_e.state == defines.train_state.wait_station then
|
||||||
local stop = train_e.station
|
local stop = train_e.station
|
||||||
if stop and stop.valid and stop.name == "train-stop" then
|
if stop and stop.valid and stop.name == "train-stop" then
|
||||||
if global.stations[stop.unit_number] then
|
if global.stations[stop.unit_number] then
|
||||||
on_train_arrives_buffer(global, stop, train)
|
if train then
|
||||||
|
on_train_arrives_buffer(global, stop, train)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
local depot = global.depots[stop.unit_number]
|
local depot = global.depots[stop.unit_number]
|
||||||
if depot then
|
if depot then
|
||||||
|
|||||||
Reference in New Issue
Block a user