Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Loading old waypoints from savegame version 72 causes crash #7587
Version of OpenTTD
The savegame loads and simulates normally.
The savegame "Sundinghattan Transport, 10th Dec 2110.sav" (#1131) always crashes on load (after a few game ticks) with "NOT_REACHED triggered at line 2711 of d:\a\1\s\src\rail_cmd.cpp". Crash files have been attached.
This is probably caused by an invalid rail track tile being accessed.
Steps to reproduce
Load the attached savegame and wait a few game ticks.
When I try to load the "Sundinghattan Transport, 10th Dec 2110.sav" save game using the 2019-05-16 (or later) version of OpenTTD master, the game crashes (Assertion failed at line 212 of d:\a\1\s\src\rail_map.h: IsPlainRailTile(t)), but says that the NewGRF "total_town_replacement_set-3.02a\ttrs3w.grf" with GRFID 56430001 and MD5 checksum AF3E0A1E6EF0B98DB966594578D1775B was not found and a compatible NewGRF was loaded, therefore no additional crash info has been generated.
Investigation shows that it's crashing on tile 50011, which looks like it's a RailTileType of
Nothing special about the waypoint on first glance...
With bisecting, I nailed down the crash to 2646a99 . There is a change in afterload.cpp in there...
With the following diff I was able to load the save in current master: (Though the game crashes somewhere in YAPF after running for a few ticks - possibly because there's a depot tile pretending to be a railtrack)
and looks like:
I notice that neither of these tiles are apparently stored in the old WAYP save block, which will presumably be why they're getting converted to depots instead. As to why they're not in the WAYP block...