Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.
This repository was archived by the owner on Dec 21, 2023. It is now read-only.

BUG: Station validity is not checked before access #28

@OvermindDL1

Description

@OvermindDL1

As per https://mods.factorio.com/mods/simwir/ShuttleTrain/discussion/694 the Shuttle-Train mod breaks when the Dynamic Stops mod is used. Although Dynamic Stops seems to be causing it, the failure is in this mod as this mod is not checking for validity of the stations before accessing them. As per my response on that thread:

Since the other mod quick adds and replaces the stops that might be the reason, but this might fix it (untested):
On line 93 change: if string.find
To become this: if station.valid and string.find

It might break again on line 98 (the table.sort) though, if it does could just delete it for now (will not show things sorted then), or maybe try changing it to be this:

table.sort(global.filtered_stations[player_id], function (a, b)
  if not a.valid or not b.valid then return false end
  return a.backer_name < b.backer_name
end)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions