summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-07 14:45:07 +0000
committerrubidium <rubidium@openttd.org>2009-01-07 14:45:07 +0000
commit5fcf07f3881b76fcccca7917ad7773ef46a75625 (patch)
tree547b9e6117c20e383e7a3ffe30e3e6a0f294d1e9 /src
parentd66d36126c4ed7cd4eef91b61174491427bb0322 (diff)
downloadopenttd-5fcf07f3881b76fcccca7917ad7773ef46a75625.tar.xz
(svn r14895) -Change: move CMD_NO_WATER from all DoCommandPs to the command table
Diffstat (limited to 'src')
-rw-r--r--src/airport_gui.cpp2
-rw-r--r--src/command.cpp274
-rw-r--r--src/command_type.h10
-rw-r--r--src/company_gui.cpp2
-rw-r--r--src/rail_gui.cpp20
-rw-r--r--src/road_gui.cpp10
-rw-r--r--src/terraform_gui.cpp2
7 files changed, 160 insertions, 160 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index b55a86b67..4e6b7bce4 100644
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -40,7 +40,7 @@ void CcBuildAirport(bool success, TileIndex tile, uint32 p1, uint32 p2)
static void PlaceAirport(TileIndex tile)
{
- DoCommandP(tile, _selected_airport_type, _ctrl_pressed, CMD_BUILD_AIRPORT | CMD_NO_WATER | CMD_MSG(STR_A001_CAN_T_BUILD_AIRPORT_HERE), CcBuildAirport);
+ DoCommandP(tile, _selected_airport_type, _ctrl_pressed, CMD_BUILD_AIRPORT | CMD_MSG(STR_A001_CAN_T_BUILD_AIRPORT_HERE), CcBuildAirport);
}
diff --git a/src/command.cpp b/src/command.cpp
index 383de91e2..37834fb66 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -204,142 +204,142 @@ DEF_COMMAND(CmdAutofillTimetable);
* as the value from the CMD_* enums.
*/
static const Command _command_proc_table[] = {
- {CmdBuildRailroadTrack, CMD_AUTO}, /* CMD_BUILD_RAILROAD_TRACK */
- {CmdRemoveRailroadTrack, CMD_AUTO}, /* CMD_REMOVE_RAILROAD_TRACK */
- {CmdBuildSingleRail, CMD_AUTO}, /* CMD_BUILD_SINGLE_RAIL */
- {CmdRemoveSingleRail, CMD_AUTO}, /* CMD_REMOVE_SINGLE_RAIL */
- {CmdLandscapeClear, 0}, /* CMD_LANDSCAPE_CLEAR */
- {CmdBuildBridge, CMD_AUTO}, /* CMD_BUILD_BRIDGE */
- {CmdBuildRailroadStation, CMD_AUTO}, /* CMD_BUILD_RAILROAD_STATION */
- {CmdBuildTrainDepot, CMD_AUTO}, /* CMD_BUILD_TRAIN_DEPOT */
- {CmdBuildSingleSignal, CMD_AUTO}, /* CMD_BUILD_SIGNALS */
- {CmdRemoveSingleSignal, CMD_AUTO}, /* CMD_REMOVE_SIGNALS */
- {CmdTerraformLand, CMD_AUTO}, /* CMD_TERRAFORM_LAND */
- {CmdPurchaseLandArea, CMD_AUTO}, /* CMD_PURCHASE_LAND_AREA */
- {CmdSellLandArea, 0}, /* CMD_SELL_LAND_AREA */
- {CmdBuildTunnel, CMD_AUTO}, /* CMD_BUILD_TUNNEL */
- {CmdRemoveFromRailroadStation, 0}, /* CMD_REMOVE_FROM_RAILROAD_STATION */
- {CmdConvertRail, 0}, /* CMD_CONVERT_RAILD */
- {CmdBuildTrainWaypoint, 0}, /* CMD_BUILD_TRAIN_WAYPOINT */
- {CmdRenameWaypoint, 0}, /* CMD_RENAME_WAYPOINT */
- {CmdRemoveTrainWaypoint, 0}, /* CMD_REMOVE_TRAIN_WAYPOINT */
-
- {CmdBuildRoadStop, CMD_AUTO}, /* CMD_BUILD_ROAD_STOP */
- {CmdRemoveRoadStop, 0}, /* CMD_REMOVE_ROAD_STOP */
- {CmdBuildLongRoad, CMD_AUTO}, /* CMD_BUILD_LONG_ROAD */
- {CmdRemoveLongRoad, CMD_NO_TEST | CMD_AUTO}, /* CMD_REMOVE_LONG_ROAD; towns may disallow removing road bits (as they are connected) in test, but in exec they're removed and thus removing is allowed. */
- {CmdBuildRoad, 0}, /* CMD_BUILD_ROAD */
- {CmdRemoveRoad, 0}, /* CMD_REMOVE_ROAD */
- {CmdBuildRoadDepot, CMD_AUTO}, /* CMD_BUILD_ROAD_DEPOT */
-
- {CmdBuildAirport, CMD_AUTO}, /* CMD_BUILD_AIRPORT */
- {CmdBuildDock, CMD_AUTO}, /* CMD_BUILD_DOCK */
- {CmdBuildShipDepot, CMD_AUTO}, /* CMD_BUILD_SHIP_DEPOT */
- {CmdBuildBuoy, CMD_AUTO}, /* CMD_BUILD_BUOY */
- {CmdPlantTree, CMD_AUTO}, /* CMD_PLANT_TREE */
- {CmdBuildRailVehicle, 0}, /* CMD_BUILD_RAIL_VEHICLE */
- {CmdMoveRailVehicle, 0}, /* CMD_MOVE_RAIL_VEHICLE */
-
- {CmdSellRailWagon, 0}, /* CMD_SELL_RAIL_WAGON */
- {CmdSendTrainToDepot, 0}, /* CMD_SEND_TRAIN_TO_DEPOT */
- {CmdForceTrainProceed, 0}, /* CMD_FORCE_TRAIN_PROCEED */
- {CmdReverseTrainDirection, 0}, /* CMD_REVERSE_TRAIN_DIRECTION */
-
- {CmdModifyOrder, 0}, /* CMD_MODIFY_ORDER */
- {CmdSkipToOrder, 0}, /* CMD_SKIP_TO_ORDER */
- {CmdDeleteOrder, 0}, /* CMD_DELETE_ORDER */
- {CmdInsertOrder, 0}, /* CMD_INSERT_ORDER */
-
- {CmdChangeServiceInt, 0}, /* CMD_CHANGE_SERVICE_INT */
-
- {CmdBuildIndustry, 0}, /* CMD_BUILD_INDUSTRY */
- {CmdBuildCompanyHQ, CMD_AUTO}, /* CMD_BUILD_COMPANY_HQ */
- {CmdSetCompanyManagerFace, 0}, /* CMD_SET_COMPANY_MANAGER_FACE */
- {CmdSetCompanyColor, 0}, /* CMD_SET_COMPANY_COLOR */
-
- {CmdIncreaseLoan, 0}, /* CMD_INCREASE_LOAN */
- {CmdDecreaseLoan, 0}, /* CMD_DECREASE_LOAN */
-
- {CmdWantEnginePreview, 0}, /* CMD_WANT_ENGINE_PREVIEW */
-
- {CmdRenameVehicle, 0}, /* CMD_RENAME_VEHICLE */
- {CmdRenameEngine, 0}, /* CMD_RENAME_ENGINE */
-
- {CmdRenameCompany, 0}, /* CMD_RENAME_COMPANY */
- {CmdRenamePresident, 0}, /* CMD_RENAME_PRESIDENT */
-
- {CmdRenameStation, 0}, /* CMD_RENAME_STATION */
-
- {CmdSellAircraft, 0}, /* CMD_SELL_AIRCRAFT */
-
- {CmdBuildAircraft, 0}, /* CMD_BUILD_AIRCRAFT */
- {CmdSendAircraftToHangar, 0}, /* CMD_SEND_AIRCRAFT_TO_HANGAR */
- {CmdRefitAircraft, 0}, /* CMD_REFIT_AIRCRAFT */
-
- {CmdPlaceSign, 0}, /* CMD_PLACE_SIGN */
- {CmdRenameSign, 0}, /* CMD_RENAME_SIGN */
-
- {CmdBuildRoadVeh, 0}, /* CMD_BUILD_ROAD_VEH */
- {CmdSellRoadVeh, 0}, /* CMD_SELL_ROAD_VEH */
- {CmdSendRoadVehToDepot, 0}, /* CMD_SEND_ROADVEH_TO_DEPOT */
- {CmdTurnRoadVeh, 0}, /* CMD_TURN_ROADVEH */
- {CmdRefitRoadVeh, 0}, /* CMD_REFIT_ROAD_VEH */
-
- {CmdPause, CMD_SERVER}, /* CMD_PAUSE */
-
- {CmdBuyShareInCompany, 0}, /* CMD_BUY_SHARE_IN_COMPANY */
- {CmdSellShareInCompany, 0}, /* CMD_SELL_SHARE_IN_COMPANY */
- {CmdBuyCompany, 0}, /* CMD_BUY_COMANY */
-
- {CmdBuildTown, CMD_OFFLINE}, /* CMD_BUILD_TOWN */
- {CmdRenameTown, CMD_SERVER}, /* CMD_RENAME_TOWN */
- {CmdDoTownAction, 0}, /* CMD_DO_TOWN_ACTION */
-
- {CmdSetRoadDriveSide, CMD_SERVER}, /* CMD_SET_ROAD_DRIVE_SIDE */
-
- {CmdSellShip, 0}, /* CMD_SELL_SHIP */
- {CmdBuildShip, 0}, /* CMD_BUILD_SHIP */
- {CmdSendShipToDepot, 0}, /* CMD_SEND_SHIP_TO_DEPOT */
- {CmdRefitShip, 0}, /* CMD_REFIT_SHIP */
-
- {CmdOrderRefit, 0}, /* CMD_ORDER_REFIT */
- {CmdCloneOrder, 0}, /* CMD_CLONE_ORDER */
-
- {CmdClearArea, CMD_NO_TEST}, /* CMD_CLEAR_AREA; destroying multi-tile houses makes town rating differ between test and execution */
-
- {CmdMoneyCheat, CMD_OFFLINE}, /* CMD_MONEY_CHEAT */
- {CmdBuildCanal, CMD_AUTO}, /* CMD_BUILD_CANAL */
- {CmdCompanyCtrl, 0}, /* CMD_COMPANY_CTRL */
-
- {CmdLevelLand, CMD_NO_TEST | CMD_AUTO}, /* CMD_LEVEL_LAND; test run might clear tiles multiple times, in execution that only happens once */
-
- {CmdRefitRailVehicle, 0}, /* CMD_REFIT_RAIL_VEHICLE */
- {CmdRestoreOrderIndex, 0}, /* CMD_RESTORE_ORDER_INDEX */
- {CmdBuildLock, CMD_AUTO}, /* CMD_BUILD_LOCK */
-
- {CmdBuildSignalTrack, CMD_AUTO}, /* CMD_BUILD_SIGNAL_TRACK */
- {CmdRemoveSignalTrack, CMD_AUTO}, /* CMD_REMOVE_SIGNAL_TRACK */
-
- {CmdGiveMoney, 0}, /* CMD_GIVE_MONEY */
- {CmdChangePatchSetting, CMD_SERVER}, /* CMD_CHANGE_PATCH_SETTING */
- {CmdSetAutoReplace, 0}, /* CMD_SET_AUTOREPLACE */
- {CmdCloneVehicle, CMD_NO_TEST}, /* CMD_CLONE_VEHICLE; NewGRF callbacks influence building and refitting making it impossible to correctly estimate the cost */
- {CmdStartStopVehicle, 0}, /* CMD_START_STOP_VEHICLE */
- {CmdMassStartStopVehicle, 0}, /* CMD_MASS_START_STOP */
- {CmdAutoreplaceVehicle, 0}, /* CMD_AUTOREPLACE_VEHICLE */
- {CmdDepotSellAllVehicles, 0}, /* CMD_DEPOT_SELL_ALL_VEHICLES */
- {CmdDepotMassAutoReplace, 0}, /* CMD_DEPOT_MASS_AUTOREPLACE */
- {CmdCreateGroup, 0}, /* CMD_CREATE_GROUP */
- {CmdDeleteGroup, 0}, /* CMD_DELETE_GROUP */
- {CmdRenameGroup, 0}, /* CMD_RENAME_GROUP */
- {CmdAddVehicleGroup, 0}, /* CMD_ADD_VEHICLE_GROUP */
- {CmdAddSharedVehicleGroup, 0}, /* CMD_ADD_SHARE_VEHICLE_GROUP */
- {CmdRemoveAllVehiclesGroup, 0}, /* CMD_REMOVE_ALL_VEHICLES_GROUP */
- {CmdSetGroupReplaceProtection, 0}, /* CMD_SET_GROUP_REPLACE_PROTECTION */
- {CmdMoveOrder, 0}, /* CMD_MOVE_ORDER */
- {CmdChangeTimetable, 0}, /* CMD_CHANGE_TIMETABLE */
- {CmdSetVehicleOnTime, 0}, /* CMD_SET_VEHICLE_ON_TIME */
- {CmdAutofillTimetable, 0}, /* CMD_AUTOFILL_TIMETABLE */
+ {CmdBuildRailroadTrack, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_RAILROAD_TRACK */
+ {CmdRemoveRailroadTrack, CMD_AUTO}, /* CMD_REMOVE_RAILROAD_TRACK */
+ {CmdBuildSingleRail, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_SINGLE_RAIL */
+ {CmdRemoveSingleRail, CMD_AUTO}, /* CMD_REMOVE_SINGLE_RAIL */
+ {CmdLandscapeClear, 0}, /* CMD_LANDSCAPE_CLEAR */
+ {CmdBuildBridge, CMD_AUTO}, /* CMD_BUILD_BRIDGE */
+ {CmdBuildRailroadStation, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_RAILROAD_STATION */
+ {CmdBuildTrainDepot, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_TRAIN_DEPOT */
+ {CmdBuildSingleSignal, CMD_AUTO}, /* CMD_BUILD_SIGNALS */
+ {CmdRemoveSingleSignal, CMD_AUTO}, /* CMD_REMOVE_SIGNALS */
+ {CmdTerraformLand, CMD_AUTO}, /* CMD_TERRAFORM_LAND */
+ {CmdPurchaseLandArea, CMD_NO_WATER | CMD_AUTO}, /* CMD_PURCHASE_LAND_AREA */
+ {CmdSellLandArea, 0}, /* CMD_SELL_LAND_AREA */
+ {CmdBuildTunnel, CMD_AUTO}, /* CMD_BUILD_TUNNEL */
+ {CmdRemoveFromRailroadStation, 0}, /* CMD_REMOVE_FROM_RAILROAD_STATION */
+ {CmdConvertRail, 0}, /* CMD_CONVERT_RAILD */
+ {CmdBuildTrainWaypoint, 0}, /* CMD_BUILD_TRAIN_WAYPOINT */
+ {CmdRenameWaypoint, 0}, /* CMD_RENAME_WAYPOINT */
+ {CmdRemoveTrainWaypoint, 0}, /* CMD_REMOVE_TRAIN_WAYPOINT */
+
+ {CmdBuildRoadStop, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_ROAD_STOP */
+ {CmdRemoveRoadStop, 0}, /* CMD_REMOVE_ROAD_STOP */
+ {CmdBuildLongRoad, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_LONG_ROAD */
+ {CmdRemoveLongRoad, CMD_NO_TEST | CMD_AUTO}, /* CMD_REMOVE_LONG_ROAD; towns may disallow removing road bits (as they are connected) in test, but in exec they're removed and thus removing is allowed. */
+ {CmdBuildRoad, 0}, /* CMD_BUILD_ROAD */
+ {CmdRemoveRoad, 0}, /* CMD_REMOVE_ROAD */
+ {CmdBuildRoadDepot, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_ROAD_DEPOT */
+
+ {CmdBuildAirport, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_AIRPORT */
+ {CmdBuildDock, CMD_AUTO}, /* CMD_BUILD_DOCK */
+ {CmdBuildShipDepot, CMD_AUTO}, /* CMD_BUILD_SHIP_DEPOT */
+ {CmdBuildBuoy, CMD_AUTO}, /* CMD_BUILD_BUOY */
+ {CmdPlantTree, CMD_AUTO}, /* CMD_PLANT_TREE */
+ {CmdBuildRailVehicle, 0}, /* CMD_BUILD_RAIL_VEHICLE */
+ {CmdMoveRailVehicle, 0}, /* CMD_MOVE_RAIL_VEHICLE */
+
+ {CmdSellRailWagon, 0}, /* CMD_SELL_RAIL_WAGON */
+ {CmdSendTrainToDepot, 0}, /* CMD_SEND_TRAIN_TO_DEPOT */
+ {CmdForceTrainProceed, 0}, /* CMD_FORCE_TRAIN_PROCEED */
+ {CmdReverseTrainDirection, 0}, /* CMD_REVERSE_TRAIN_DIRECTION */
+
+ {CmdModifyOrder, 0}, /* CMD_MODIFY_ORDER */
+ {CmdSkipToOrder, 0}, /* CMD_SKIP_TO_ORDER */
+ {CmdDeleteOrder, 0}, /* CMD_DELETE_ORDER */
+ {CmdInsertOrder, 0}, /* CMD_INSERT_ORDER */
+
+ {CmdChangeServiceInt, 0}, /* CMD_CHANGE_SERVICE_INT */
+
+ {CmdBuildIndustry, 0}, /* CMD_BUILD_INDUSTRY */
+ {CmdBuildCompanyHQ, CMD_NO_WATER | CMD_AUTO}, /* CMD_BUILD_COMPANY_HQ */
+ {CmdSetCompanyManagerFace, 0}, /* CMD_SET_COMPANY_MANAGER_FACE */
+ {CmdSetCompanyColor, 0}, /* CMD_SET_COMPANY_COLOR */
+
+ {CmdIncreaseLoan, 0}, /* CMD_INCREASE_LOAN */
+ {CmdDecreaseLoan, 0}, /* CMD_DECREASE_LOAN */
+
+ {CmdWantEnginePreview, 0}, /* CMD_WANT_ENGINE_PREVIEW */
+
+ {CmdRenameVehicle, 0}, /* CMD_RENAME_VEHICLE */
+ {CmdRenameEngine, 0}, /* CMD_RENAME_ENGINE */
+
+ {CmdRenameCompany, 0}, /* CMD_RENAME_COMPANY */
+ {CmdRenamePresident, 0}, /* CMD_RENAME_PRESIDENT */
+
+ {CmdRenameStation, 0}, /* CMD_RENAME_STATION */
+
+ {CmdSellAircraft, 0}, /* CMD_SELL_AIRCRAFT */
+
+ {CmdBuildAircraft, 0}, /* CMD_BUILD_AIRCRAFT */
+ {CmdSendAircraftToHangar, 0}, /* CMD_SEND_AIRCRAFT_TO_HANGAR */
+ {CmdRefitAircraft, 0}, /* CMD_REFIT_AIRCRAFT */
+
+ {CmdPlaceSign, 0}, /* CMD_PLACE_SIGN */
+ {CmdRenameSign, 0}, /* CMD_RENAME_SIGN */
+
+ {CmdBuildRoadVeh, 0}, /* CMD_BUILD_ROAD_VEH */
+ {CmdSellRoadVeh, 0}, /* CMD_SELL_ROAD_VEH */
+ {CmdSendRoadVehToDepot, 0}, /* CMD_SEND_ROADVEH_TO_DEPOT */
+ {CmdTurnRoadVeh, 0}, /* CMD_TURN_ROADVEH */
+ {CmdRefitRoadVeh, 0}, /* CMD_REFIT_ROAD_VEH */
+
+ {CmdPause, CMD_SERVER}, /* CMD_PAUSE */
+
+ {CmdBuyShareInCompany, 0}, /* CMD_BUY_SHARE_IN_COMPANY */
+ {CmdSellShareInCompany, 0}, /* CMD_SELL_SHARE_IN_COMPANY */
+ {CmdBuyCompany, 0}, /* CMD_BUY_COMANY */
+
+ {CmdBuildTown, CMD_OFFLINE}, /* CMD_BUILD_TOWN */
+ {CmdRenameTown, CMD_SERVER}, /* CMD_RENAME_TOWN */
+ {CmdDoTownAction, 0}, /* CMD_DO_TOWN_ACTION */
+
+ {CmdSetRoadDriveSide, CMD_SERVER}, /* CMD_SET_ROAD_DRIVE_SIDE */
+
+ {CmdSellShip, 0}, /* CMD_SELL_SHIP */
+ {CmdBuildShip, 0}, /* CMD_BUILD_SHIP */
+ {CmdSendShipToDepot, 0}, /* CMD_SEND_SHIP_TO_DEPOT */
+ {CmdRefitShip, 0}, /* CMD_REFIT_SHIP */
+
+ {CmdOrderRefit, 0}, /* CMD_ORDER_REFIT */
+ {CmdCloneOrder, 0}, /* CMD_CLONE_ORDER */
+
+ {CmdClearArea, CMD_NO_TEST}, /* CMD_CLEAR_AREA; destroying multi-tile houses makes town rating differ between test and execution */
+
+ {CmdMoneyCheat, CMD_OFFLINE}, /* CMD_MONEY_CHEAT */
+ {CmdBuildCanal, CMD_AUTO}, /* CMD_BUILD_CANAL */
+ {CmdCompanyCtrl, 0}, /* CMD_COMPANY_CTRL */
+
+ {CmdLevelLand, CMD_NO_TEST | CMD_AUTO}, /* CMD_LEVEL_LAND; test run might clear tiles multiple times, in execution that only happens once */
+
+ {CmdRefitRailVehicle, 0}, /* CMD_REFIT_RAIL_VEHICLE */
+ {CmdRestoreOrderIndex, 0}, /* CMD_RESTORE_ORDER_INDEX */
+ {CmdBuildLock, CMD_AUTO}, /* CMD_BUILD_LOCK */
+
+ {CmdBuildSignalTrack, CMD_AUTO}, /* CMD_BUILD_SIGNAL_TRACK */
+ {CmdRemoveSignalTrack, CMD_AUTO}, /* CMD_REMOVE_SIGNAL_TRACK */
+
+ {CmdGiveMoney, 0}, /* CMD_GIVE_MONEY */
+ {CmdChangePatchSetting, CMD_SERVER}, /* CMD_CHANGE_PATCH_SETTING */
+ {CmdSetAutoReplace, 0}, /* CMD_SET_AUTOREPLACE */
+ {CmdCloneVehicle, CMD_NO_TEST}, /* CMD_CLONE_VEHICLE; NewGRF callbacks influence building and refitting making it impossible to correctly estimate the cost */
+ {CmdStartStopVehicle, 0}, /* CMD_START_STOP_VEHICLE */
+ {CmdMassStartStopVehicle, 0}, /* CMD_MASS_START_STOP */
+ {CmdAutoreplaceVehicle, 0}, /* CMD_AUTOREPLACE_VEHICLE */
+ {CmdDepotSellAllVehicles, 0}, /* CMD_DEPOT_SELL_ALL_VEHICLES */
+ {CmdDepotMassAutoReplace, 0}, /* CMD_DEPOT_MASS_AUTOREPLACE */
+ {CmdCreateGroup, 0}, /* CMD_CREATE_GROUP */
+ {CmdDeleteGroup, 0}, /* CMD_DELETE_GROUP */
+ {CmdRenameGroup, 0}, /* CMD_RENAME_GROUP */
+ {CmdAddVehicleGroup, 0}, /* CMD_ADD_VEHICLE_GROUP */
+ {CmdAddSharedVehicleGroup, 0}, /* CMD_ADD_SHARE_VEHICLE_GROUP */
+ {CmdRemoveAllVehiclesGroup, 0}, /* CMD_REMOVE_ALL_VEHICLES_GROUP */
+ {CmdSetGroupReplaceProtection, 0}, /* CMD_SET_GROUP_REPLACE_PROTECTION */
+ {CmdMoveOrder, 0}, /* CMD_MOVE_ORDER */
+ {CmdChangeTimetable, 0}, /* CMD_CHANGE_TIMETABLE */
+ {CmdSetVehicleOnTime, 0}, /* CMD_SET_VEHICLE_ON_TIME */
+ {CmdAutofillTimetable, 0}, /* CMD_AUTOFILL_TIMETABLE */
};
/*!
@@ -506,7 +506,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
uint32 flags = 0;
/* Command flags are used internally */
uint cmd_flags = GetCommandFlags(cmd);
- if (cmd & CMD_NO_WATER) flags |= DC_NO_WATER;
+ if (cmd_flags & CMD_NO_WATER) flags |= DC_NO_WATER;
if (cmd_flags & CMD_AUTO) flags |= DC_AUTO;
bool notest = (cmd_flags & CMD_NO_TEST) != 0;
diff --git a/src/command_type.h b/src/command_type.h
index 19d3452a7..ccbd3704d 100644
--- a/src/command_type.h
+++ b/src/command_type.h
@@ -324,7 +324,6 @@ enum {
* This enumeration defines some flags which are binary-or'ed on a command.
*/
enum {
- CMD_NO_WATER = 0x0400, ///< dont build on water
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
CMD_SHOW_NO_ERROR = 0x2000, ///< do not show the error message
@@ -338,10 +337,11 @@ enum {
* This enumeration defines flags for the _command_proc_table.
*/
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
- CMD_NO_TEST = 0x8, ///< the command's output may differ between test and execute due to town rating changes etc.
+ CMD_SERVER = 0x01, ///< the command can only be initiated by the server
+ CMD_OFFLINE = 0x02, ///< the command cannot be executed in a multiplayer game; single-player only
+ CMD_AUTO = 0x04, ///< set the DC_AUTO flag on this command
+ CMD_NO_TEST = 0x08, ///< the command's output may differ between test and execute due to town rating changes etc.
+ CMD_NO_WATER = 0x10, ///< set the DC_NO_WATER flag on this command
};
/**
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 7be5c05ab..712f092f7 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -1310,7 +1310,7 @@ struct CompanyWindow : Window
virtual void OnPlaceObject(Point pt, TileIndex tile)
{
- if (DoCommandP(tile, 0, 0, CMD_BUILD_COMPANY_HQ | CMD_NO_WATER | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS)))
+ if (DoCommandP(tile, 0, 0, CMD_BUILD_COMPANY_HQ | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS)))
ResetObjectToPlace();
this->widget[CW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; // this button can now behave as a normal push button
this->RaiseButtons();
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index c6fd07b8a..9161bf5f2 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -81,8 +81,8 @@ static void GenericPlaceRail(TileIndex tile, int cmd)
{
DoCommandP(tile, _cur_railtype, cmd,
_remove_button_clicked ?
- 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,
+ CMD_REMOVE_SINGLE_RAIL | CMD_MSG(STR_1012_CAN_T_REMOVE_RAILROAD_TRACK) :
+ CMD_BUILD_SINGLE_RAIL | CMD_MSG(STR_1011_CAN_T_BUILD_RAILROAD_TRACK),
CcPlaySound1E
);
}
@@ -125,7 +125,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, CMD_BUILD_SINGLE_RAIL | CMD_NO_WATER);
+ DoCommandP(tile, _cur_railtype, extra & 0xFF, CMD_BUILD_SINGLE_RAIL);
}
/** Additional pieces of track to add at the entrance of a depot. */
@@ -157,7 +157,7 @@ void CcRailDepot(bool success, TileIndex tile, uint32 p1, uint32 p2)
static void PlaceRail_Depot(TileIndex tile)
{
DoCommandP(tile, _cur_railtype, _build_depot_direction,
- CMD_BUILD_TRAIN_DEPOT | CMD_NO_WATER | CMD_MSG(STR_100E_CAN_T_BUILD_TRAIN_DEPOT),
+ CMD_BUILD_TRAIN_DEPOT | CMD_MSG(STR_100E_CAN_T_BUILD_TRAIN_DEPOT),
CcRailDepot);
}
@@ -191,7 +191,7 @@ static void PlaceRail_Station(TileIndex tile)
DoCommandP(tile,
_railstation.orientation | (_settings_client.gui.station_numtracks << 8) | (_settings_client.gui.station_platlength << 16) | (_ctrl_pressed << 24),
_cur_railtype | (_railstation.station_class << 8) | (_railstation.station_type << 16),
- CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION), CcStation);
+ CMD_BUILD_RAILROAD_STATION | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION), CcStation);
}
}
@@ -514,8 +514,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),
_remove_button_clicked ?
- 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)
+ CMD_REMOVE_RAILROAD_TRACK | CMD_MSG(STR_1012_CAN_T_REMOVE_RAILROAD_TRACK) :
+ CMD_BUILD_RAILROAD_TRACK | CMD_MSG(STR_1011_CAN_T_BUILD_RAILROAD_TRACK)
);
}
@@ -572,8 +572,8 @@ static void HandleAutoSignalPlacement()
TileVirtXY(thd->selend.x, thd->selend.y),
p2,
_remove_button_clicked ?
- 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),
+ CMD_REMOVE_SIGNAL_TRACK | CMD_MSG(STR_1013_CAN_T_REMOVE_SIGNALS_FROM) :
+ CMD_BUILD_SIGNAL_TRACK | CMD_MSG(STR_1010_CAN_T_BUILD_SIGNALS_HERE),
CcPlaySound1E);
}
@@ -878,7 +878,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),
- CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION), CcStation);
+ CMD_BUILD_RAILROAD_STATION | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION), CcStation);
}
struct BuildRailStationWindow : public PickerWindowBase {
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index 7d3f79825..79a37d723 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -200,7 +200,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, CMD_BUILD_ROAD_DEPOT | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_depot), CcRoadDepot);
+ DoCommandP(tile, _cur_roadtype << 2 | _road_depot_orientation, 0, CMD_BUILD_ROAD_DEPOT | CMD_MSG(_road_type_infos[_cur_roadtype].err_depot), CcRoadDepot);
}
static void PlaceRoadStop(TileIndex tile, uint32 p2, uint32 cmd)
@@ -219,7 +219,7 @@ static void PlaceRoad_BusStation(TileIndex tile)
if (_remove_button_clicked) {
DoCommandP(tile, 0, ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound1D);
} else {
- 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]));
+ PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | ROADSTOP_BUS, CMD_BUILD_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[ROADSTOP_BUS]));
}
}
@@ -228,7 +228,7 @@ static void PlaceRoad_TruckStation(TileIndex tile)
if (_remove_button_clicked) {
DoCommandP(tile, 0, ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound1D);
} else {
- 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]));
+ PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | ROADSTOP_TRUCK, CMD_BUILD_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[ROADSTOP_TRUCK]));
}
}
@@ -598,8 +598,8 @@ struct BuildRoadToolbarWindow : Window {
DoCommandP(end_tile, start_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5),
(_ctrl_pressed || _remove_button_clicked) ?
- 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), CcPlaySound1D);
+ CMD_REMOVE_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) :
+ CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound1D);
break;
}
}
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 74760f791..296339ce6 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -155,7 +155,7 @@ void CcPlaySound1E(bool success, TileIndex tile, uint32 p1, uint32 p2);
static void PlaceProc_BuyLand(TileIndex tile)
{
- DoCommandP(tile, 0, 0, CMD_PURCHASE_LAND_AREA | CMD_NO_WATER | CMD_MSG(STR_5806_CAN_T_PURCHASE_THIS_LAND), CcPlaySound1E);
+ DoCommandP(tile, 0, 0, CMD_PURCHASE_LAND_AREA | CMD_MSG(STR_5806_CAN_T_PURCHASE_THIS_LAND), CcPlaySound1E);
}
void PlaceProc_DemolishArea(TileIndex tile)