Fix: [Emscripten] config not saved on exit game (#11248)
When changing a Game Option and pressing Exit Game, the changes were not actually stored. This because the post-mainloop code was never executed for Emscripten.
This commit is contained in:
@@ -459,6 +459,22 @@ struct AfterNewGRFScan : NewGRFScanCallback {
|
||||
}
|
||||
};
|
||||
|
||||
void PostMainLoop()
|
||||
{
|
||||
WaitTillSaved();
|
||||
|
||||
/* only save config if we have to */
|
||||
if (_save_config) {
|
||||
SaveToConfig();
|
||||
SaveHotkeysToConfig();
|
||||
WindowDesc::SaveToConfig();
|
||||
SaveToHighScore();
|
||||
}
|
||||
|
||||
/* Reset windowing system, stop drivers, free used memory, ... */
|
||||
ShutdownGame();
|
||||
}
|
||||
|
||||
#if defined(UNIX)
|
||||
extern void DedicatedFork();
|
||||
#endif
|
||||
@@ -785,18 +801,7 @@ int openttd_main(int argc, char *argv[])
|
||||
|
||||
VideoDriver::GetInstance()->MainLoop();
|
||||
|
||||
WaitTillSaved();
|
||||
|
||||
/* only save config if we have to */
|
||||
if (_save_config) {
|
||||
SaveToConfig();
|
||||
SaveHotkeysToConfig();
|
||||
WindowDesc::SaveToConfig();
|
||||
SaveToHighScore();
|
||||
}
|
||||
|
||||
/* Reset windowing system, stop drivers, free used memory, ... */
|
||||
ShutdownGame();
|
||||
PostMainLoop();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user