You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In src/saveload/station_sl.cpp there are a number of static globals used for loading, which are read depending on the savegame version.
In particular, _num_flows is read if the version is >= 183, and written in the save code, but is never cleared otherwise.
It is unconditionally read in the STNN load code shortly after it is conditionally read, and used to conditionally control reading more bytes from the chunk.
If it happens to be non-zero when loading a savegame version < 183, the loader gets out of sync with the save game state and aborts due to chunk length mismatches or similar.
As this leaves the game state in a mess it crashes when trying to load the title game afterwards.
_num_flows can be left non-zero if the last station in the pool has 1 or more flows for cargo 31.
The _cargo_source_xy, _cargo_days, and _cargo_feeder_share variables have similar but less severe issues.
A possible fix is attached.
I haven't looked extensively for similar issues in other parts of the savegame code.
Loading the first savegame attached and then the second one should trigger the bug.
JGR opened the ticket and wrote:
Attachments
Reported version: trunk
Operating system: All
This issue was imported from FlySpray: https://bugs.openttd.org/task/6540
The text was updated successfully, but these errors were encountered: