mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-12 16:12:38 -06:00
added null check
This commit is contained in:
@@ -181,6 +181,7 @@ function set_manifest_schedule(map_data, train, depot_name, d_surface_i, p_stop,
|
|||||||
if (is_p_on_t or p_surface_i == other_surface_i) and (is_r_on_t or r_surface_i == other_surface_i) and (is_d_on_t or d_surface_i == other_surface_i) then
|
if (is_p_on_t or p_surface_i == other_surface_i) and (is_r_on_t or r_surface_i == other_surface_i) and (is_d_on_t or d_surface_i == other_surface_i) then
|
||||||
local t_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = t_surface_i})--[[@as {}]]
|
local t_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = t_surface_i})--[[@as {}]]
|
||||||
local other_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = other_surface_i})--[[@as {}]]
|
local other_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = other_surface_i})--[[@as {}]]
|
||||||
|
if t_zone and other_zone then
|
||||||
local is_train_in_orbit = other_zone.orbit_index == t_zone.index
|
local is_train_in_orbit = other_zone.orbit_index == t_zone.index
|
||||||
if is_train_in_orbit or t_zone.orbit_index == other_zone.index then
|
if is_train_in_orbit or t_zone.orbit_index == other_zone.index then
|
||||||
local elevator_name = se_get_space_elevator_name(t_surface)
|
local elevator_name = se_get_space_elevator_name(t_surface)
|
||||||
@@ -217,6 +218,7 @@ function set_manifest_schedule(map_data, train, depot_name, d_surface_i, p_stop,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
--NOTE: create a schedule that cannot be fulfilled, the train will be stuck but it will give the player information what went wrong
|
--NOTE: create a schedule that cannot be fulfilled, the train will be stuck but it will give the player information what went wrong
|
||||||
train.schedule = {current = 1, records = {
|
train.schedule = {current = 1, records = {
|
||||||
create_inactivity_order(depot_name),
|
create_inactivity_order(depot_name),
|
||||||
|
|||||||
Reference in New Issue
Block a user