[2.0.37] LuaSchedule::add_record adds temporary stops at the beginning of the schedule
Posted: Fri Feb 28, 2025 3:20 am
( this is a debugging session with an actual train and schedule )
ok, so adding two regular stops in order works. "aaa_second" gets added after 'zzz_first'
But a temporary stop gets added at the top of the schedule, not the bottom. The docs state Adds a record to the end of the current schedule using the provided data.
Code: Select all
> for i = 1, train_schedule.get_record_count() do print(serpent.line(train_schedule.get_record{ schedule_index = i })) end
(nil)
> train_schedule.add_record { station = 'zzz_first' }
> train_schedule.add_record { station = 'aaa_second' }
> for i = 1, train_schedule.get_record_count() do print(serpent.line(train_schedule.get_record{ schedule_index = i })) end
{allows_unloading = true, created_by_interrupt = false, station = "zzz_first", temporary = false, wait_conditions = {}}
{allows_unloading = true, created_by_interrupt = false, station = "aaa_second", temporary = false, wait_conditions = {}}
(nil)
Code: Select all
> for i = 1, train_schedule.get_record_count() do print(serpent.line(train_schedule.get_record{ schedule_index = i })) end
(nil)
> train_schedule.add_record { station = 'zzz_first' }
> train_schedule.add_record { station = 'aaa_second', temporary = true }
> for i = 1, train_schedule.get_record_count() do print(serpent.line(train_schedule.get_record{ schedule_index = i })) end
{allows_unloading = true, created_by_interrupt = false, station = "aaa_second", temporary = true, wait_conditions = {{compare_type = "and", ticks = 300, type = "time"}}}
{allows_unloading = true, created_by_interrupt = false, station = "zzz_first", temporary = false, wait_conditions = {}}
(nil)