Page 1 of 1

[.15.10] Out of bounds train schedule crash

Posted: Tue May 16, 2017 4:14 am
by Nexela

Code: Select all

local records = {}
for _, name in pairs ({"#SOUTH", "#EAST", "#NORTH", "#WEST"}) do
    records[#records + 1] = {station = name, wait_conditions = {{type = "time", ticks = 0, compare_type = "and"}}}
end
  records[1].wait_conditions = {{type = "full", compare_type = "and"}}
  train.schedule = {current = 0, records = records}  --<<<<< Don't set it to 0
Game crashes when opening up the locomotive to view the schedule. Fixed by setting it a valid #records number.

Re: [.15.10] Out of bounds train schedule crash

Posted: Tue May 16, 2017 5:42 am
by Rseding91
Thanks for the report. I've fixed it so now trying to set the current record to an invalid index will give a script error.