summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2013-01-08 21:08:18 +0000
committerzuu <zuu@openttd.org>2013-01-08 21:08:18 +0000
commitfd8f5cff5d4d432c54e4cf7bf549a3355cf8725f (patch)
tree2278a0543286f995e113756dac762a2ccc9f523a /src
parent8f681a7a1049a789efd985b2523637606e2f6040 (diff)
downloadopenttd-fd8f5cff5d4d432c54e4cf7bf549a3355cf8725f.tar.xz
(svn r24898) -Fix: Don't unpause the game when closing the highscore window if it was already paused before the highscore screen was shown.
Diffstat (limited to 'src')
-rw-r--r--src/highscore_gui.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp
index af4dbf6dd..079b16e7f 100644
--- a/src/highscore_gui.cpp
+++ b/src/highscore_gui.cpp
@@ -148,10 +148,13 @@ struct EndGameWindow : EndGameHighScoreBaseWindow {
};
struct HighScoreWindow : EndGameHighScoreBaseWindow {
+ bool game_paused_by_player; ///< True if the game was paused by the player when the highscore window was opened.
+
HighScoreWindow(const WindowDesc *desc, int difficulty, int8 ranking) : EndGameHighScoreBaseWindow(desc)
{
/* pause game to show the chart */
- if (!_networking) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE);
+ this->game_paused_by_player = _pause_mode == PM_PAUSED_NORMAL;
+ if (!_networking && !this->game_paused_by_player) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE);
/* Close all always on-top windows to get a clean screen */
if (_game_mode != GM_MENU) HideVitalWindows();
@@ -166,7 +169,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow {
{
if (_game_mode != GM_MENU) ShowVitalWindows();
- if (!_networking) DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); // unpause
+ if (!_networking && !this->game_paused_by_player) DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); // unpause
}
virtual void OnPaint()