summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-07 21:09:30 +0000
committerrubidium <rubidium@openttd.org>2010-12-07 21:09:30 +0000
commit49162ab39b7c2bb473fccaa7b693b226033fd584 (patch)
treece35309020d5c8b35fdc5033130aae96c0f3046d /src/window.cpp
parente170b1d83e0142fdcc4260a2f3d623324de1415f (diff)
downloadopenttd-49162ab39b7c2bb473fccaa7b693b226033fd584.tar.xz
(svn r21428) -Fix [FS#4021]: vehicles could be built while the game it paused. Now you can enable or disable that with a setting
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 1e85a42c0..7d1f6e120 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2213,13 +2213,34 @@ static void MouseLoop(MouseClick click, int mousewheel)
case MC_DOUBLE_LEFT:
case MC_LEFT:
DEBUG(misc, 2, "Cursor: 0x%X (%d)", _cursor.sprite, _cursor.sprite);
- if (_thd.place_mode != HT_NONE &&
- /* query button and place sign button work in pause mode */
- _cursor.sprite != SPR_CURSOR_QUERY &&
- _cursor.sprite != SPR_CURSOR_SIGN &&
- _pause_mode != PM_UNPAUSED &&
- !_cheats.build_in_pause.value) {
- return;
+ if (_thd.place_mode != HT_NONE && _pause_mode != PM_UNPAUSED) {
+ switch (_settings_game.construction.command_pause_level) {
+ case CMDPL_ALL_ACTIONS:
+ /* We allow all actions. */
+ break;
+
+ case CMDPL_NO_LANDSCAPING:
+ if (_cursor.sprite == SPR_CURSOR_CLONE_TRAIN ||
+ _cursor.sprite == SPR_CURSOR_CLONE_ROADVEH ||
+ _cursor.sprite == SPR_CURSOR_CLONE_SHIP ||
+ _cursor.sprite == SPR_CURSOR_CLONE_AIRPLANE) {
+ /* Cloning is allowed. */
+ break;
+ }
+ /* FALL THROUGH */
+ case CMDPL_NO_CONSTRUCTION:
+ if (_cursor.sprite == SPR_CURSOR_SIGN ||
+ (_cursor.sprite >= SPR_CURSOR_PICKSTATION_FIRST && _cursor.sprite <= SPR_CURSOR_PICKSTATION_LAST)) {
+ /* Building signs or making orders is allowed. */
+ break;
+ }
+ /* FALL THROUGH */
+ case CMDPL_NO_ACTIONS:
+ if (_cursor.sprite == SPR_CURSOR_QUERY) break;
+
+ /* All other ones are not allowed to build. */
+ return;
+ }
}
if (!HandleViewportClicked(vp, x, y) &&