[2.0.46] train.schedule = train.schedule, index out of bounds

This subforum contains all the issues which we already resolved.
User avatar
Quezler
Fast Inserter
Fast Inserter
Posts: 184
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

[2.0.46] train.schedule = train.schedule, index out of bounds

Post by Quezler »

- create a world
- place rails
- place locomotive
- give it an interrupt
- /c game.player.selected.train.schedule = game.player.selected.train.schedule
(note that platforms are also affected, but you can figure out those repro steps)

When a train has no schedule and no interrupts `train.schedule` is nil, as expected.
But when there are interrupts only .schedule` returns {current = 1, records = {}}

This cannot be written back to .schedule since it complains that there is no record at index 1.

Since this "legacy schedule" only contains scheduled records it should just return nil when the train has no active schedules, regardless of configured interrupts.

devs: see #7591
Post Reply

Return to “Resolved Problems and Bugs”