summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-07-02 17:40:39 +0000
committerfrosch <frosch@openttd.org>2011-07-02 17:40:39 +0000
commit7bf8b1d96e9bf3932465666c2c1db8538a48d846 (patch)
treee0236de1a49291548f120265c4530e756b28b5d5 /src
parent55a21a940d81b57b6c889a2839cb592690da404c (diff)
downloadopenttd-7bf8b1d96e9bf3932465666c2c1db8538a48d846.tar.xz
(svn r22621) -Fix: When asking the user to confirm an unsafe unpausing, there is no need to execute a command if 'no' is choosed. This also prevents crashing when clicking unpause while the confirm window is shown.
Diffstat (limited to 'src')
-rw-r--r--src/misc_cmd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index 1f6ee839a..ff16c9272 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -125,7 +125,9 @@ CommandCost CmdDecreaseLoan(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
*/
static void AskUnsafeUnpauseCallback(Window *w, bool confirmed)
{
- DoCommandP(0, PM_PAUSED_ERROR, confirmed ? 0 : 1, CMD_PAUSE);
+ if (confirmed) {
+ DoCommandP(0, PM_PAUSED_ERROR, 0, CMD_PAUSE);
+ }
}
/**