(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

@@ -472,8 +472,15 @@ DEF_CONSOLE_CMD(ConPauseGame)
return true;
}
if (_pause_game == 0) {
DoCommandP(0, 1, 0, CMD_PAUSE);
#ifdef ENABLE_NETWORK
if (_network_dedicated && _settings_client.network.min_active_clients != 0) {
IConsolePrint(CC_WARNING, "Manual pausing is disabled. Set network.min_active_clients to 0 (disable autopausing) to enable manual pausing.");
return true;
}
#endif /* ENABLE_NETWORK */
if (_pause_mode == PM_UNPAUSED) {
DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE);
IConsolePrint(CC_DEFAULT, "Game paused.");
} else {
IConsolePrint(CC_DEFAULT, "Game is already paused.");
@@ -489,8 +496,15 @@ DEF_CONSOLE_CMD(ConUnPauseGame)
return true;
}
if (_pause_game != 0) {
DoCommandP(0, 0, 0, CMD_PAUSE);
#ifdef ENABLE_NETWORK
if (_network_dedicated && _settings_client.network.min_active_clients != 0) {
IConsolePrint(CC_WARNING, "Manual unpausing is disabled. Set network.min_active_clients to 0 (disable autopausing) to enable manual unpausing.");
return true;
}
#endif /* ENABLE_NETWORK */
if (_pause_mode != PM_UNPAUSED) {
DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE);
IConsolePrint(CC_DEFAULT, "Game unpaused.");
} else {
IConsolePrint(CC_DEFAULT, "Game is already unpaused.");