From 47faf78e12179db1423f0f2ec2d33ee675366a20 Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Thu, 8 Dec 2022 11:40:55 -0500 Subject: [PATCH] fixed schedule generation --- cybersyn/scripts/factorio-api.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cybersyn/scripts/factorio-api.lua b/cybersyn/scripts/factorio-api.lua index f520b32..8b6167c 100644 --- a/cybersyn/scripts/factorio-api.lua +++ b/cybersyn/scripts/factorio-api.lua @@ -200,6 +200,10 @@ end function add_refueler_schedule(train, stop) local schedule = train.schedule or {current = 1, records = {}} local i = schedule.current + if i == 1 then + i = #schedule.records + 1--[[@as uint]] + schedule.current = i + end local t_surface = train.front_stock.surface local f_surface = stop.surface