mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 13:23:46 +00:00
(svn r19044) -Codechange: don't load the 'new game' NewGRFs when you're certain the savegame wouldn't have been saved with them, i.e. don't load the 'new game' NewGRFs for TTO savegames.
This commit is contained in:
parent
da2722da36
commit
78f31c1744
@ -1844,6 +1844,12 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, boo
|
|||||||
if (mode == SL_OLD_LOAD) {
|
if (mode == SL_OLD_LOAD) {
|
||||||
_engine_mngr.ResetToDefaultMapping();
|
_engine_mngr.ResetToDefaultMapping();
|
||||||
InitializeGame(256, 256, true, true); // set a mapsize of 256x256 for TTDPatch games or it might get confused
|
InitializeGame(256, 256, true, true); // set a mapsize of 256x256 for TTDPatch games or it might get confused
|
||||||
|
|
||||||
|
/* TTD/TTO savegames have no NewGRFs, TTDP savegame have them
|
||||||
|
* and if so a new NewGRF list will be made in LoadOldSaveGame.
|
||||||
|
* Note: this is done here because AfterLoadGame is also called
|
||||||
|
* for OTTD savegames which have their own NewGRF logic. */
|
||||||
|
ClearGRFConfigList(&_grfconfig);
|
||||||
GamelogReset();
|
GamelogReset();
|
||||||
if (!LoadOldSaveGame(filename)) return SL_REINIT;
|
if (!LoadOldSaveGame(filename)) return SL_REINIT;
|
||||||
_sl_version = 0;
|
_sl_version = 0;
|
||||||
@ -1974,6 +1980,31 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, boo
|
|||||||
|
|
||||||
GamelogReset();
|
GamelogReset();
|
||||||
|
|
||||||
|
if (CheckSavegameVersion(4)) {
|
||||||
|
/*
|
||||||
|
* NewGRFs were introduced between 0.3,4 and 0.3.5, which both
|
||||||
|
* shared savegame version 4. Anything before that 'obviously'
|
||||||
|
* does not have any NewGRFs. Between the introduction and
|
||||||
|
* savegame version 41 (just before 0.5) the NewGRF settings
|
||||||
|
* were not stored in the savegame and they were loaded by
|
||||||
|
* using the settings from the main menu.
|
||||||
|
* So, to recap:
|
||||||
|
* - savegame version < 4: do not load any NewGRFs.
|
||||||
|
* - savegame version >= 41: load NewGRFs from savegame, which is
|
||||||
|
* already done at this stage by
|
||||||
|
* overwriting the main menu settings.
|
||||||
|
* - other savegame versions: use main menu settings.
|
||||||
|
*
|
||||||
|
* This means that users *can* crash savegame version 4..40
|
||||||
|
* savegames if they set incompatible NewGRFs in the main menu,
|
||||||
|
* but can't crash anymore for savegame version < 4 savegames.
|
||||||
|
*
|
||||||
|
* Note: this is done here because AfterLoadGame is also called
|
||||||
|
* for TTO/TTD/TTDP savegames which have their own NewGRF logic.
|
||||||
|
*/
|
||||||
|
ClearGRFConfigList(&_grfconfig);
|
||||||
|
}
|
||||||
|
|
||||||
SlLoadChunks();
|
SlLoadChunks();
|
||||||
SlFixPointers();
|
SlFixPointers();
|
||||||
fmt->uninit_read();
|
fmt->uninit_read();
|
||||||
|
Loading…
Reference in New Issue
Block a user