Index: src/water_cmd.cpp =================================================================== --- src/water_cmd.cpp (revision 13667) +++ src/water_cmd.cpp (working copy) @@ -344,7 +344,7 @@ * @param tile end tile of stretch-dragging * @param flags type of operation * @param p1 start tile of stretch-dragging - * @param p2 specifies canal (0), water (1) or river (2); last two can only be built in scenario editor + * @param p2 specifies canal (0), water (1) or river (2); water can only be built in scenario editor */ CommandCost CmdBuildCanal(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { @@ -356,8 +356,8 @@ if (p1 >= MapSize()) return CMD_ERROR; - /* Outside of the editor you can only build canals, not oceans */ - if (p2 != 0 && _game_mode != GM_EDITOR) return CMD_ERROR; + /* Outside of the editor you may not build oceans */ + if (p2 == 1 && _game_mode != GM_EDITOR) return CMD_ERROR; x = TileX(tile); y = TileY(tile); @@ -380,8 +380,8 @@ return_cmd_error(STR_0007_FLAT_LAND_REQUIRED); } - /* can't make water of water! */ - if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || p2 == 1)) continue; + /* skip tile if it already has the right type */ + if (IsTileType(tile, MP_WATER) && (p2 == 1 && IsSea(tile) || (p2 == 0 && IsCanal(tile)) || (p2 == 2 && IsRiver(tile)))) continue; ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); if (CmdFailed(ret)) return ret; @@ -400,6 +400,7 @@ } cost.AddCost(_price.clear_water); + if (p2 == 2) cost.AddCost(_price.clear_water * 3); } END_TILE_LOOP(tile, size_x, size_y, 0); if (cost.GetCost() == 0) { Index: src/dock_gui.cpp =================================================================== --- src/dock_gui.cpp (revision 13667) +++ src/dock_gui.cpp (working copy) @@ -87,7 +87,7 @@ DTW_CAPTION, ///< Window caption DTW_STICKY, ///< Sticky window button DTW_BUTTONS_BEGIN, ///< Begin of clickable buttons (except seperating panel) - DTW_CANAL = DTW_BUTTONS_BEGIN, ///< Build canal button + DTW_CANAL = DTW_BUTTONS_BEGIN, ///< Build canal button DTW_LOCK, ///< Build lock button DTW_SEPERATOR, ///< Seperating panel between lock and demolish DTW_DEMOLISH, ///< Demolish aka dynamite button @@ -136,7 +136,6 @@ static void BuildDocksClick_River(Window *w) { - if (_game_mode != GM_EDITOR) return; HandlePlacePushButton(w, DTW_RIVER, SPR_CURSOR_RIVER, VHM_RECT, PlaceDocks_BuildRiver); } @@ -227,7 +226,6 @@ case DDSP_CREATE_RIVER: DoCommandP(end_tile, start_tile, 2, CcBuildCanal, CMD_BUILD_CANAL | CMD_MSG(STR_CANT_PLACE_RIVERS)); break; - default: break; } } @@ -252,8 +250,8 @@ static const Widget _build_docks_toolb_widgets[] = { { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // DTW_CLOSEBOX -{ WWT_CAPTION, RESIZE_NONE, 7, 11, 147, 0, 13, STR_9801_WATERWAYS_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // DTW_CAPTION -{ WWT_STICKYBOX, RESIZE_NONE, 7, 148, 159, 0, 13, 0x0, STR_STICKY_BUTTON}, // DTW_STICKY +{ WWT_CAPTION, RESIZE_NONE, 7, 11, 168, 0, 13, STR_9801_WATERWAYS_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // DTW_CAPTION +{ WWT_STICKYBOX, RESIZE_NONE, 7, 169, 180, 0, 13, 0x0, STR_STICKY_BUTTON}, // DTW_STICKY { WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_BUILD_CANAL, STR_BUILD_CANALS_TIP}, // DTW_CANAL { WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_BUILD_LOCK, STR_BUILD_LOCKS_TIP}, // DTW_LOCK @@ -263,13 +261,13 @@ { WWT_IMGBTN, RESIZE_NONE, 7, 71, 92, 14, 35, SPR_IMG_SHIP_DEPOT, STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING}, // DTW_DEPOT { WWT_IMGBTN, RESIZE_NONE, 7, 93, 114, 14, 35, SPR_IMG_SHIP_DOCK, STR_981D_BUILD_SHIP_DOCK}, // DTW_STATION { WWT_IMGBTN, RESIZE_NONE, 7, 115, 136, 14, 35, SPR_IMG_BOUY, STR_9834_POSITION_BUOY_WHICH_CAN}, // DTW_BUOY -{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, // DTW_RIVER -{ WWT_IMGBTN, RESIZE_NONE, 7, 137, 159, 14, 35, SPR_IMG_AQUEDUCT, STR_BUILD_AQUEDUCT}, // DTW_BUILD_AQUEDUCT +{ WWT_IMGBTN, RESIZE_NONE, 7, 137, 158, 14, 35, SPR_IMG_BUILD_RIVER, STR_CREATE_RIVER}, // DTW_RIVER +{ WWT_IMGBTN, RESIZE_NONE, 7, 159, 180, 14, 35, SPR_IMG_AQUEDUCT, STR_BUILD_AQUEDUCT}, // DTW_BUILD_AQUEDUCT { WIDGETS_END}, }; static const WindowDesc _build_docks_toolbar_desc = { - WDP_ALIGN_TBR, 22, 160, 36, 160, 36, + WDP_ALIGN_TBR, 22, 181, 36, 181, 36, WC_BUILD_TOOLBAR, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _build_docks_toolb_widgets,