From b89d13cdbf1b51c8fc547f13740f7e7876c2a071 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 10 Mar 2007 21:44:22 +0000 Subject: (svn r9105) -Fix [FS#629]: disable the ability to make flooding water with the canal build tool. In the scenario editor you can still make both canals and flooding water at height level 0. --- src/dock_gui.cpp | 2 +- src/water_cmd.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 184c69ea9..77282403c 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -156,7 +156,7 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e) if ((e->we.place.userdata & 0xF) == VPM_X_AND_Y) { // dragged actions GUIPlaceProcDragXY(e); } else if (e->we.place.userdata == VPM_X_OR_Y) { - DoCommandP(e->we.place.tile, e->we.place.starttile, _ctrl_pressed, CcBuildCanal, CMD_BUILD_CANAL | CMD_AUTO | CMD_MSG(STR_CANT_BUILD_CANALS)); + DoCommandP(e->we.place.tile, e->we.place.starttile, 0, CcBuildCanal, CMD_BUILD_CANAL | CMD_AUTO | CMD_MSG(STR_CANT_BUILD_CANALS)); } } break; diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 4b1270797..5643aa8fe 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -212,7 +212,7 @@ int32 CmdBuildLock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) /** Build a piece of canal. * @param tile end tile of stretch-dragging * @param p1 start tile of stretch-dragging - * @param p2 ctrl pressed - toggles ocean / canals at sealevel + * @param p2 ctrl pressed - toggles ocean / canals at sealevel (ocean only allowed in the scenario editor) */ int32 CmdBuildCanal(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { @@ -223,6 +223,8 @@ int32 CmdBuildCanal(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) int sx, sy; if (p1 >= MapSize()) return CMD_ERROR; + /* Outside of the editor you can only build canals, not oceans */ + if (HASBIT(p2, 0) && _game_mode != GM_EDITOR) return CMD_ERROR; x = TileX(tile); y = TileY(tile); -- cgit v1.2.3-54-g00ecf