diff options
author | rubidium <rubidium@openttd.org> | 2007-09-04 11:58:27 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-09-04 11:58:27 +0000 |
commit | 9706c32ed69f560199ea6232fb5078876912e1e9 (patch) | |
tree | eb509837e511a15770453fc1943e2b7c7180be64 | |
parent | b1effc466eac33997567e2f2e68812afb1c0a7f6 (diff) | |
download | openttd-9706c32ed69f560199ea6232fb5078876912e1e9.tar.xz |
(svn r11040) -Fix [FS#1179]: removing CMD_AUTO from some commands could remotely trigger an assertion.
-rw-r--r-- | src/ai/ai.cpp | 1 | ||||
-rw-r--r-- | src/airport_gui.cpp | 2 | ||||
-rw-r--r-- | src/bridge_gui.cpp | 2 | ||||
-rw-r--r-- | src/command.cpp | 57 | ||||
-rw-r--r-- | src/command.h | 2 | ||||
-rw-r--r-- | src/dock_gui.cpp | 10 | ||||
-rw-r--r-- | src/main_gui.cpp | 4 | ||||
-rw-r--r-- | src/misc_gui.cpp | 2 | ||||
-rw-r--r-- | src/player_gui.cpp | 2 | ||||
-rw-r--r-- | src/rail_gui.cpp | 28 | ||||
-rw-r--r-- | src/road_gui.cpp | 12 | ||||
-rw-r--r-- | src/terraform_gui.cpp | 8 |
12 files changed, 65 insertions, 65 deletions
diff --git a/src/ai/ai.cpp b/src/ai/ai.cpp index 8086ef29a..1f85fc981 100644 --- a/src/ai/ai.cpp +++ b/src/ai/ai.cpp @@ -106,7 +106,6 @@ CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, u /* If we did a DC_EXEC, and the command did not return an error, execute it * over the network */ - if (flags & DC_AUTO) procc |= CMD_AUTO; if (flags & DC_NO_WATER) procc |= CMD_NO_WATER; /* NetworkSend_Command needs _local_player to be set correctly, so diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 33721fec8..814916c0d 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -34,7 +34,7 @@ void CcBuildAirport(bool success, TileIndex tile, uint32 p1, uint32 p2) static void PlaceAirport(TileIndex tile) { - DoCommandP(tile, _selected_airport_type, _ctrl_pressed, CcBuildAirport, CMD_BUILD_AIRPORT | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_A001_CAN_T_BUILD_AIRPORT_HERE)); + DoCommandP(tile, _selected_airport_type, _ctrl_pressed, CcBuildAirport, CMD_BUILD_AIRPORT | CMD_NO_WATER | CMD_MSG(STR_A001_CAN_T_BUILD_AIRPORT_HERE)); } static void PlaceAir_DemolishArea(TileIndex tile) diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 3a2fdb6e2..091a1e686 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -36,7 +36,7 @@ static void BuildBridge(Window *w, int i) DeleteWindow(w); DoCommandP(_bridgedata.end_tile, _bridgedata.start_tile, _bridgedata.indexes[i] | (_bridgedata.type << 8), CcBuildBridge, - CMD_BUILD_BRIDGE | CMD_AUTO | CMD_MSG(STR_5015_CAN_T_BUILD_BRIDGE_HERE)); + CMD_BUILD_BRIDGE | CMD_MSG(STR_5015_CAN_T_BUILD_BRIDGE_HERE)); } static void BuildBridgeWndProc(Window *w, WindowEvent *e) diff --git a/src/command.cpp b/src/command.cpp index c48b3418d..6d26279e2 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -184,20 +184,20 @@ DEF_COMMAND(CmdAutofillTimetable); /* The master command table */ static const Command _command_proc_table[] = { - {CmdBuildRailroadTrack, 0}, /* 0 */ - {CmdRemoveRailroadTrack, 0}, /* 1 */ - {CmdBuildSingleRail, 0}, /* 2 */ - {CmdRemoveSingleRail, 0}, /* 3 */ + {CmdBuildRailroadTrack, CMD_AUTO}, /* 0 */ + {CmdRemoveRailroadTrack, CMD_AUTO}, /* 1 */ + {CmdBuildSingleRail, CMD_AUTO}, /* 2 */ + {CmdRemoveSingleRail, CMD_AUTO}, /* 3 */ {CmdLandscapeClear, 0}, /* 4 */ - {CmdBuildBridge, 0}, /* 5 */ - {CmdBuildRailroadStation, 0}, /* 6 */ - {CmdBuildTrainDepot, 0}, /* 7 */ - {CmdBuildSingleSignal, 0}, /* 8 */ - {CmdRemoveSingleSignal, 0}, /* 9 */ - {CmdTerraformLand, 0}, /* 10 */ - {CmdPurchaseLandArea, 0}, /* 11 */ + {CmdBuildBridge, CMD_AUTO}, /* 5 */ + {CmdBuildRailroadStation, CMD_AUTO}, /* 6 */ + {CmdBuildTrainDepot, CMD_AUTO}, /* 7 */ + {CmdBuildSingleSignal, CMD_AUTO}, /* 8 */ + {CmdRemoveSingleSignal, CMD_AUTO}, /* 9 */ + {CmdTerraformLand, CMD_AUTO}, /* 10 */ + {CmdPurchaseLandArea, CMD_AUTO}, /* 11 */ {CmdSellLandArea, 0}, /* 12 */ - {CmdBuildTunnel, 0}, /* 13 */ + {CmdBuildTunnel, CMD_AUTO}, /* 13 */ {CmdRemoveFromRailroadStation, 0}, /* 14 */ {CmdConvertRail, 0}, /* 15 */ {CmdBuildTrainWaypoint, 0}, /* 16 */ @@ -205,19 +205,19 @@ static const Command _command_proc_table[] = { {CmdRemoveTrainWaypoint, 0}, /* 18 */ {NULL, 0}, /* 19 */ {NULL, 0}, /* 20 */ - {CmdBuildRoadStop, 0}, /* 21 */ + {CmdBuildRoadStop, CMD_AUTO}, /* 21 */ {CmdRemoveRoadStop, 0}, /* 22 */ - {CmdBuildLongRoad, 0}, /* 23 */ - {CmdRemoveLongRoad, 0}, /* 24 */ + {CmdBuildLongRoad, CMD_AUTO}, /* 23 */ + {CmdRemoveLongRoad, CMD_AUTO}, /* 24 */ {CmdBuildRoad, 0}, /* 25 */ {CmdRemoveRoad, 0}, /* 26 */ - {CmdBuildRoadDepot, 0}, /* 27 */ + {CmdBuildRoadDepot, CMD_AUTO}, /* 27 */ {NULL, 0}, /* 28 */ - {CmdBuildAirport, 0}, /* 29 */ - {CmdBuildDock, 0}, /* 30 */ - {CmdBuildShipDepot, 0}, /* 31 */ - {CmdBuildBuoy, 0}, /* 32 */ - {CmdPlantTree, 0}, /* 33 */ + {CmdBuildAirport, CMD_AUTO}, /* 29 */ + {CmdBuildDock, CMD_AUTO}, /* 30 */ + {CmdBuildShipDepot, CMD_AUTO}, /* 31 */ + {CmdBuildBuoy, CMD_AUTO}, /* 32 */ + {CmdPlantTree, CMD_AUTO}, /* 33 */ {CmdBuildRailVehicle, 0}, /* 34 */ {CmdMoveRailVehicle, 0}, /* 35 */ {CmdStartStopTrain, 0}, /* 36 */ @@ -235,7 +235,7 @@ static const Command _command_proc_table[] = { {CmdChangeServiceInt, 0}, /* 46 */ {CmdBuildIndustry, 0}, /* 47 */ - {CmdBuildCompanyHQ, 0}, /* 48 */ + {CmdBuildCompanyHQ, CMD_AUTO}, /* 48 */ {CmdSetPlayerFace, 0}, /* 49 */ {CmdSetPlayerColor, 0}, /* 50 */ @@ -308,17 +308,17 @@ static const Command _command_proc_table[] = { {NULL, 0}, /* 101 */ {CmdMoneyCheat, CMD_OFFLINE}, /* 102 */ - {CmdBuildCanal, 0}, /* 103 */ + {CmdBuildCanal, CMD_AUTO}, /* 103 */ {CmdPlayerCtrl, 0}, /* 104 */ - {CmdLevelLand, 0}, /* 105 */ + {CmdLevelLand, CMD_AUTO}, /* 105 */ {CmdRefitRailVehicle, 0}, /* 106 */ {CmdRestoreOrderIndex, 0}, /* 107 */ - {CmdBuildLock, 0}, /* 108 */ + {CmdBuildLock, CMD_AUTO}, /* 108 */ {NULL, 0}, /* 109 */ - {CmdBuildSignalTrack, 0}, /* 110 */ - {CmdRemoveSignalTrack, 0}, /* 111 */ + {CmdBuildSignalTrack, CMD_AUTO}, /* 110 */ + {CmdRemoveSignalTrack, CMD_AUTO}, /* 111 */ {NULL, 0}, /* 112 */ {CmdGiveMoney, 0}, /* 113 */ {CmdChangePatchSetting, CMD_SERVER}, /* 114 */ @@ -462,7 +462,6 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, } flags = 0; - if (cmd & CMD_AUTO) flags |= DC_AUTO; if (cmd & CMD_NO_WATER) flags |= DC_NO_WATER; /* get pointer to command handler */ @@ -473,6 +472,8 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, return false; } + if (GetCommandFlags(cmd) & CMD_AUTO) flags |= DC_AUTO; + /* Some commands have a different output in dryrun than the realrun * e.g.: if you demolish a whole town, the dryrun would say okay. * but by really destroying, your rating drops and at a certain point diff --git a/src/command.h b/src/command.h index 65fc0c495..2ae566172 100644 --- a/src/command.h +++ b/src/command.h @@ -172,7 +172,6 @@ enum { #define CMD_MSG(x) ((x) << 16) enum { - CMD_AUTO = 0x0200, CMD_NO_WATER = 0x0400, CMD_NETWORK_COMMAND = 0x0800, ///< execute the command without sending it on the network CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network @@ -183,6 +182,7 @@ enum { enum { CMD_SERVER = 0x1, ///< the command can only be initiated by the server CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only + CMD_AUTO = 0x4, ///< set the DC_AUTO flag on this command }; typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2); diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 135f1f166..b030438c8 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -38,17 +38,17 @@ void CcBuildCanal(bool success, TileIndex tile, uint32 p1, uint32 p2) static void PlaceDocks_Dock(TileIndex tile) { - DoCommandP(tile, _ctrl_pressed, 0, CcBuildDocks, CMD_BUILD_DOCK | CMD_AUTO | CMD_MSG(STR_9802_CAN_T_BUILD_DOCK_HERE)); + DoCommandP(tile, _ctrl_pressed, 0, CcBuildDocks, CMD_BUILD_DOCK | CMD_MSG(STR_9802_CAN_T_BUILD_DOCK_HERE)); } static void PlaceDocks_Depot(TileIndex tile) { - DoCommandP(tile, _ship_depot_direction, 0, CcBuildDocks, CMD_BUILD_SHIP_DEPOT | CMD_AUTO | CMD_MSG(STR_3802_CAN_T_BUILD_SHIP_DEPOT)); + DoCommandP(tile, _ship_depot_direction, 0, CcBuildDocks, CMD_BUILD_SHIP_DEPOT | CMD_MSG(STR_3802_CAN_T_BUILD_SHIP_DEPOT)); } static void PlaceDocks_Buoy(TileIndex tile) { - DoCommandP(tile, 0, 0, CcBuildDocks, CMD_BUILD_BUOY | CMD_AUTO | CMD_MSG(STR_9835_CAN_T_POSITION_BUOY_HERE)); + DoCommandP(tile, 0, 0, CcBuildDocks, CMD_BUILD_BUOY | CMD_MSG(STR_9835_CAN_T_POSITION_BUOY_HERE)); } static void PlaceDocks_DemolishArea(TileIndex tile) @@ -63,7 +63,7 @@ static void PlaceDocks_BuildCanal(TileIndex tile) static void PlaceDocks_BuildLock(TileIndex tile) { - DoCommandP(tile, 0, 0, CcBuildDocks, CMD_BUILD_LOCK | CMD_AUTO | CMD_MSG(STR_CANT_BUILD_LOCKS)); + DoCommandP(tile, 0, 0, CcBuildDocks, CMD_BUILD_LOCK | CMD_MSG(STR_CANT_BUILD_LOCKS)); } @@ -162,7 +162,7 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e) GUIPlaceProcDragXY(e); break; case DDSP_CREATE_WATER: - DoCommandP(e->we.place.tile, e->we.place.starttile, 0, 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_MSG(STR_CANT_BUILD_CANALS)); break; default: break; } diff --git a/src/main_gui.cpp b/src/main_gui.cpp index cdd79c998..447aef59b 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -1086,7 +1086,7 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) StringID msg = mode ? STR_0808_CAN_T_RAISE_LAND_HERE : STR_0809_CAN_T_LOWER_LAND_HERE; - DoCommandP(tile, SLOPE_N, (uint32)mode, CcTerraform, CMD_TERRAFORM_LAND | CMD_AUTO | CMD_MSG(msg)); + DoCommandP(tile, SLOPE_N, (uint32)mode, CcTerraform, CMD_TERRAFORM_LAND | CMD_MSG(msg)); } else { SndPlayTileFx(SND_1F_SPLAT, tile); @@ -1113,7 +1113,7 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) { if (TileHeight(tile2) == h) { - DoCommandP(tile2, SLOPE_N, (uint32)mode, NULL, CMD_TERRAFORM_LAND | CMD_AUTO); + DoCommandP(tile2, SLOPE_N, (uint32)mode, NULL, CMD_TERRAFORM_LAND); } } END_TILE_LOOP(tile2, sizex, sizey, tile) } diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 4af381d28..64bb1e9f1 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -396,7 +396,7 @@ static void BuildTreesWndProc(Window *w, WindowEvent *e) case WE_PLACE_MOUSEUP: if (e->we.place.pt.x != -1 && e->we.place.select_proc == DDSP_PLANT_TREES) { DoCommandP(e->we.place.tile, _tree_to_plant, e->we.place.starttile, NULL, - CMD_PLANT_TREE | CMD_AUTO | CMD_MSG(STR_2805_CAN_T_PLANT_TREE_HERE)); + CMD_PLANT_TREE | CMD_MSG(STR_2805_CAN_T_PLANT_TREE_HERE)); } break; diff --git a/src/player_gui.cpp b/src/player_gui.cpp index c832ac06d..f0af0366d 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -834,7 +834,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) break; case WE_PLACE_OBJ: - if (DoCommandP(e->we.place.tile, 0, 0, NULL, CMD_BUILD_COMPANY_HQ | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS))) + if (DoCommandP(e->we.place.tile, 0, 0, NULL, CMD_BUILD_COMPANY_HQ | CMD_NO_WATER | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS))) ResetObjectToPlace(); w->widget[PCW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; // this button can now behave as a normal push button RaiseWindowButtons(w); diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index dddd0061c..21ff04986 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -66,8 +66,8 @@ static void GenericPlaceRail(TileIndex tile, int cmd) { DoCommandP(tile, _cur_railtype, cmd, CcPlaySound1E, _remove_button_clicked ? - CMD_REMOVE_SINGLE_RAIL | CMD_MSG(STR_1012_CAN_T_REMOVE_RAILROAD_TRACK) | CMD_AUTO | CMD_NO_WATER : - CMD_BUILD_SINGLE_RAIL | CMD_MSG(STR_1011_CAN_T_BUILD_RAILROAD_TRACK) | CMD_AUTO | CMD_NO_WATER + CMD_REMOVE_SINGLE_RAIL | CMD_MSG(STR_1012_CAN_T_REMOVE_RAILROAD_TRACK) | CMD_NO_WATER : + CMD_BUILD_SINGLE_RAIL | CMD_MSG(STR_1011_CAN_T_BUILD_RAILROAD_TRACK) | CMD_NO_WATER ); } @@ -103,7 +103,7 @@ static void PlaceExtraDepotRail(TileIndex tile, uint16 extra) if (GetRailTileType(tile) != RAIL_TILE_NORMAL) return; if ((GetTrackBits(tile) & GB(extra, 8, 8)) == 0) return; - DoCommandP(tile, _cur_railtype, extra & 0xFF, NULL, CMD_BUILD_SINGLE_RAIL | CMD_AUTO | CMD_NO_WATER); + DoCommandP(tile, _cur_railtype, extra & 0xFF, NULL, CMD_BUILD_SINGLE_RAIL | CMD_NO_WATER); } static const uint16 _place_depot_extra[12] = { @@ -134,7 +134,7 @@ void CcRailDepot(bool success, TileIndex tile, uint32 p1, uint32 p2) static void PlaceRail_Depot(TileIndex tile) { DoCommandP(tile, _cur_railtype, _build_depot_direction, CcRailDepot, - CMD_BUILD_TRAIN_DEPOT | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_100E_CAN_T_BUILD_TRAIN_DEPOT)); + CMD_BUILD_TRAIN_DEPOT | CMD_NO_WATER | CMD_MSG(STR_100E_CAN_T_BUILD_TRAIN_DEPOT)); } static void PlaceRail_Waypoint(TileIndex tile) @@ -166,7 +166,7 @@ static void PlaceRail_Station(TileIndex tile) DoCommandP(tile, _railstation.orientation | (_railstation.numtracks << 8) | (_railstation.platlength << 16) | (_ctrl_pressed << 24), _cur_railtype | (_railstation.station_class << 8) | (_railstation.station_type << 16), CcStation, - CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); + CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); } } @@ -190,10 +190,10 @@ static void GenericPlaceSignals(TileIndex tile) SB(p1, 4, 1, _cur_year < _patches.semaphore_build_before); DoCommandP(tile, p1, 0, CcPlaySound1E, - CMD_BUILD_SIGNALS | CMD_AUTO | CMD_MSG(STR_1010_CAN_T_BUILD_SIGNALS_HERE)); + CMD_BUILD_SIGNALS | CMD_MSG(STR_1010_CAN_T_BUILD_SIGNALS_HERE)); } else { DoCommandP(tile, track, 0, CcPlaySound1E, - CMD_REMOVE_SIGNALS | CMD_AUTO | CMD_MSG(STR_1013_CAN_T_REMOVE_SIGNALS_FROM)); + CMD_REMOVE_SIGNALS | CMD_MSG(STR_1013_CAN_T_REMOVE_SIGNALS_FROM)); } } @@ -215,12 +215,12 @@ void CcBuildRailTunnel(bool success, TileIndex tile, uint32 p1, uint32 p2) static void PlaceRail_Tunnel(TileIndex tile) { DoCommandP(tile, _cur_railtype, 0, CcBuildRailTunnel, - CMD_BUILD_TUNNEL | CMD_AUTO | CMD_MSG(STR_5016_CAN_T_BUILD_TUNNEL_HERE)); + CMD_BUILD_TUNNEL | CMD_MSG(STR_5016_CAN_T_BUILD_TUNNEL_HERE)); } void PlaceProc_BuyLand(TileIndex tile) { - DoCommandP(tile, 0, 0, CcPlaySound1E, CMD_PURCHASE_LAND_AREA | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_5806_CAN_T_PURCHASE_THIS_LAND)); + DoCommandP(tile, 0, 0, CcPlaySound1E, CMD_PURCHASE_LAND_AREA | CMD_NO_WATER | CMD_MSG(STR_5806_CAN_T_PURCHASE_THIS_LAND)); } static void PlaceRail_ConvertRail(TileIndex tile) @@ -346,8 +346,8 @@ static void DoRailroadTrack(int mode) { DoCommandP(TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), _cur_railtype | (mode << 4), NULL, _remove_button_clicked ? - CMD_REMOVE_RAILROAD_TRACK | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_1012_CAN_T_REMOVE_RAILROAD_TRACK) : - CMD_BUILD_RAILROAD_TRACK | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_1011_CAN_T_BUILD_RAILROAD_TRACK) + CMD_REMOVE_RAILROAD_TRACK | CMD_NO_WATER | CMD_MSG(STR_1012_CAN_T_REMOVE_RAILROAD_TRACK) : + CMD_BUILD_RAILROAD_TRACK | CMD_NO_WATER | CMD_MSG(STR_1011_CAN_T_BUILD_RAILROAD_TRACK) ); } @@ -388,8 +388,8 @@ static void HandleAutoSignalPlacement() p2, CcPlaySound1E, _remove_button_clicked ? - CMD_REMOVE_SIGNAL_TRACK | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_1013_CAN_T_REMOVE_SIGNALS_FROM) : - CMD_BUILD_SIGNAL_TRACK | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_1010_CAN_T_BUILD_SIGNALS_HERE) + CMD_REMOVE_SIGNAL_TRACK | CMD_NO_WATER | CMD_MSG(STR_1013_CAN_T_REMOVE_SIGNALS_FROM) : + CMD_BUILD_SIGNAL_TRACK | CMD_NO_WATER | CMD_MSG(STR_1010_CAN_T_BUILD_SIGNALS_HERE) ); } @@ -671,7 +671,7 @@ static void HandleStationPlacement(TileIndex start, TileIndex end) DoCommandP(TileXY(sx, sy), _railstation.orientation | (w << 8) | (h << 16) | (_ctrl_pressed << 24), _cur_railtype | (_railstation.station_class << 8) | (_railstation.station_type << 16), CcStation, - CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); + CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); } /* Check if the currently selected station size is allowed */ diff --git a/src/road_gui.cpp b/src/road_gui.cpp index d71cb3fc8..a1800adea 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -115,7 +115,7 @@ static const RoadTypeInfo _road_type_infos[] = { static void PlaceRoad_Tunnel(TileIndex tile) { - DoCommandP(tile, 0x200 | RoadTypeToRoadTypes(_cur_roadtype), 0, CcBuildRoadTunnel, CMD_BUILD_TUNNEL | CMD_AUTO | CMD_MSG(STR_5016_CAN_T_BUILD_TUNNEL_HERE)); + DoCommandP(tile, 0x200 | RoadTypeToRoadTypes(_cur_roadtype), 0, CcBuildRoadTunnel, CMD_BUILD_TUNNEL | CMD_MSG(STR_5016_CAN_T_BUILD_TUNNEL_HERE)); } static void BuildRoadOutsideStation(TileIndex tile, DiagDirection direction) @@ -143,7 +143,7 @@ void CcRoadDepot(bool success, TileIndex tile, uint32 p1, uint32 p2) static void PlaceRoad_Depot(TileIndex tile) { - DoCommandP(tile, _cur_roadtype << 2 | _road_depot_orientation, 0, CcRoadDepot, CMD_BUILD_ROAD_DEPOT | CMD_AUTO | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_depot)); + DoCommandP(tile, _cur_roadtype << 2 | _road_depot_orientation, 0, CcRoadDepot, CMD_BUILD_ROAD_DEPOT | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_depot)); } static void PlaceRoadStop(TileIndex tile, uint32 p2, uint32 cmd) @@ -162,7 +162,7 @@ static void PlaceRoad_BusStation(TileIndex tile) if (_remove_button_clicked) { DoCommandP(tile, 0, RoadStop::BUS, CcPlaySound1D, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[RoadStop::BUS])); } else { - PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | RoadStop::BUS, CMD_BUILD_ROAD_STOP | CMD_AUTO | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[RoadStop::BUS])); + PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | RoadStop::BUS, CMD_BUILD_ROAD_STOP | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[RoadStop::BUS])); } } @@ -171,7 +171,7 @@ static void PlaceRoad_TruckStation(TileIndex tile) if (_remove_button_clicked) { DoCommandP(tile, 0, RoadStop::TRUCK, CcPlaySound1D, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[RoadStop::TRUCK])); } else { - PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | RoadStop::TRUCK, CMD_BUILD_ROAD_STOP | CMD_AUTO | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[RoadStop::TRUCK])); + PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | RoadStop::TRUCK, CMD_BUILD_ROAD_STOP | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[RoadStop::TRUCK])); } } @@ -347,8 +347,8 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) case DDSP_PLACE_ROAD_NW: DoCommandP(end_tile, start_tile, _place_road_flag | (_cur_roadtype << 3) | _ctrl_pressed << 5, CcPlaySound1D, _remove_button_clicked ? - CMD_REMOVE_LONG_ROAD | CMD_AUTO | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) : - CMD_BUILD_LONG_ROAD | CMD_AUTO | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road)); + CMD_REMOVE_LONG_ROAD | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) : + CMD_BUILD_LONG_ROAD | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road)); break; } } diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 59d1b9ed0..c2e0bb530 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -109,7 +109,7 @@ bool GUIPlaceProcDragXY(const WindowEvent *e) DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_CLEAR_AREA | CMD_MSG(STR_00B5_CAN_T_CLEAR_THIS_AREA)); break; case DDSP_LEVEL_AREA: - DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_LEVEL_LAND | CMD_AUTO); + DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_LEVEL_LAND); break; case DDSP_CREATE_ROCKS: GenerateRockyArea(end_tile, start_tile); @@ -118,7 +118,7 @@ bool GUIPlaceProcDragXY(const WindowEvent *e) GenerateDesertArea(end_tile, start_tile); break; case DDSP_CREATE_WATER: - DoCommandP(end_tile, start_tile, _ctrl_pressed, CcBuildCanal, CMD_BUILD_CANAL | CMD_AUTO | CMD_MSG(STR_CANT_BUILD_CANALS)); + DoCommandP(end_tile, start_tile, _ctrl_pressed, CcBuildCanal, CMD_BUILD_CANAL | CMD_MSG(STR_CANT_BUILD_CANALS)); break; default: return false; @@ -148,7 +148,7 @@ static void PlaceProc_RaiseLand(TileIndex tile) { DoCommandP( tile, SLOPE_N, 1, CcTerraform, - CMD_TERRAFORM_LAND | CMD_AUTO | CMD_MSG(STR_0808_CAN_T_RAISE_LAND_HERE) + CMD_TERRAFORM_LAND | CMD_MSG(STR_0808_CAN_T_RAISE_LAND_HERE) ); } @@ -156,7 +156,7 @@ static void PlaceProc_LowerLand(TileIndex tile) { DoCommandP( tile, SLOPE_N, 0, CcTerraform, - CMD_TERRAFORM_LAND | CMD_AUTO | CMD_MSG(STR_0809_CAN_T_LOWER_LAND_HERE) + CMD_TERRAFORM_LAND | CMD_MSG(STR_0809_CAN_T_LOWER_LAND_HERE) ); } |