From 7757a04f9150f1c596151c14183c425825361eae Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Sun, 16 Oct 2022 19:03:49 -0400 Subject: [PATCH] fixed minor bug --- cybersyn/scripts/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cybersyn/scripts/main.lua b/cybersyn/scripts/main.lua index bdc9526..e34bb42 100644 --- a/cybersyn/scripts/main.lua +++ b/cybersyn/scripts/main.lua @@ -164,7 +164,8 @@ local function on_station_broken(map_data, stop) local station = map_data.stations[station_id] if station.deliveries_total > 0 then for train_id, train in pairs(map_data.trains) do - local is_r = train.p_station_id == station_id + local is_r = train.r_station_id == station_id + local is_p = train.p_station_id == station_id if is_p or is_r then local is_p_delivery_made = train.status ~= STATUS_D_TO_P and train.status ~= STATUS_P local is_r_delivery_made = train.status == STATUS_R_TO_D @@ -191,8 +192,8 @@ local function on_station_rename(map_data, stop) local station = map_data.stations[station_id] if station.deliveries_total > 0 then for train_id, train in pairs(map_data.trains) do - local is_p = train.r_station_id == station_id - local is_r = train.p_station_id == station_id + local is_p = train.p_station_id == station_id + local is_r = train.r_station_id == station_id if is_p or is_r then local is_p_delivery_made = train.status ~= STATUS_D_TO_P and train.status ~= STATUS_P local is_r_delivery_made = train.status == STATUS_R_TO_D