diff options
Diffstat (limited to 'src/console_cmds.cpp')
-rw-r--r-- | src/console_cmds.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index ced66db8b..42e707846 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -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."); |