Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
If you change the game mode 9 times in succession, then the game crashes on the ninth attempt. #7590
Version of OpenTTD
The game doesn't crash at all when creating a new map, loading a saved game, or otherwise modifying the game state.
On the ninth time that you create a new world, load a saved game, or otherwise modify the gamemode, the game crashes hard. Note that the exact crash is different depending on the last game-mode-modifying action you took, but there are two similar crash logs that account for all situations mentioned below.
Steps to reproduce
Create a new world, load a saved game, start scenario editor, connect to or (re)start a server, return to the title screen, or otherwise modify the game mode 9 times. The 1st through 8th attempts will go through, but the 9th attempt crashes with either an E06D7363 error or C0000005 error.
Edit: Just running "rescanai" 9 times or running "rescangame" 18 times is enough to crash the game with this log (should be similar to above).
Hard crash call stack:
Seems it's doing ScriptConfig::GetSetting(nullptr) and crash on
Other crash call stack:
As for number of command "rescanai" or "rescangame" reruns, it is the same no matter the RAM limit set in openttd.cfg. However, the number of Ais and Game Scripts and the complexity of their info.nut files do affect the number of times that "rescanai" or "rescangame" need to be rerun until a crash occurs. For example, with all AIs and Game Scripts available on Bananas, it takes 10-15 loops until crash. With just a single PathZilla AI, it takes 1000-1500 loops until crash.