(svn r16242) -Codechange: rework pausing

-Fix [FS#2864]: autopause and manual pausing conflict with eachother
-Fix: new game + pause on new game + autopause make the game not unpause on the first join
This commit is contained in:
rubidium
2009-05-06 15:06:57 +00:00
parent bb121a1510
commit 2664f2a2d9
29 changed files with 110 additions and 79 deletions

View File

@@ -336,6 +336,10 @@ bool AfterLoadGame()
if (CheckSavegameVersion(98)) GamelogGRFAddList(_grfconfig);
if (CheckSavegameVersion(119)) {
_pause_mode = (_pause_mode == 2) ? PM_PAUSED_NORMAL : PM_UNPAUSED;
}
/* in very old versions, size of train stations was stored differently */
if (CheckSavegameVersion(2)) {
Station *st;
@@ -440,7 +444,7 @@ bool AfterLoadGame()
switch (gcf_res) {
case GLC_COMPATIBLE: _switch_mode_errorstr = STR_NEWGRF_COMPATIBLE_LOAD_WARNING; break;
case GLC_NOT_FOUND: _switch_mode_errorstr = STR_NEWGRF_DISABLED_WARNING; _pause_game = -1; break;
case GLC_NOT_FOUND: _switch_mode_errorstr = STR_NEWGRF_DISABLED_WARNING; _pause_mode = PM_PAUSED_ERROR; break;
default: break;
}

View File

@@ -74,7 +74,7 @@ static const SaveLoadGlobVarList _date_desc[] = {
SLEG_CONDVAR(_next_competitor_start, SLE_FILE_U16 | SLE_VAR_U32, 0, 108),
SLEG_CONDVAR(_next_competitor_start, SLE_UINT32, 109, SL_MAX_VERSION),
SLEG_VAR(_trees_tick_ctr, SLE_UINT8),
SLEG_CONDVAR(_pause_game, SLE_UINT8, 4, SL_MAX_VERSION),
SLEG_CONDVAR(_pause_mode, SLE_UINT8, 4, SL_MAX_VERSION),
SLEG_CONDVAR(_cur_town_iter, SLE_UINT32, 11, SL_MAX_VERSION),
SLEG_END()
};

View File

@@ -302,7 +302,7 @@ bool LoadOldSaveGame(const char *file)
return false;
}
_pause_game = 2;
_pause_mode = 2;
return true;
}

View File

@@ -40,7 +40,7 @@
#include "saveload_internal.h"
extern const uint16 SAVEGAME_VERSION = 118;
extern const uint16 SAVEGAME_VERSION = 119;
SavegameType _savegame_type; ///< type of savegame we are loading