File diff r10854:9dc46af240e5 → r10855:5a3c2f38f98e
src/command.cpp
Show inline comments
 
@@ -214,7 +214,7 @@ static const Command _command_proc_table
 
	{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 */
 
	{CmdTerraformLand,       CMD_ALL_TILES | 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 */
 
@@ -311,7 +311,7 @@ static const Command _command_proc_table
 
	{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 */
 
	{CmdLevelLand, CMD_ALL_TILES | 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 */
 
@@ -403,7 +403,7 @@ CommandCost DoCommand(TileIndex tile, ui
 
	CommandCost res;
 

	
 
	/* Do not even think about executing out-of-bounds tile-commands */
 
	if (!IsValidTile(tile)) return CMD_ERROR;
 
	if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (flags & DC_ALL_TILES) == 0))) return CMD_ERROR;
 

	
 
	CommandProc *proc = _command_proc_table[cmd].proc;
 

	
 
@@ -497,9 +497,6 @@ bool DoCommandP(TileIndex tile, uint32 p
 
{
 
	assert(_docommand_recursive == 0);
 

	
 
	/* Do not even think about executing out-of-bounds tile-commands */
 
	if (!IsValidTile(tile)) return false;
 

	
 
	CommandCost res, res2;
 

	
 
	int x = TileX(tile) * TILE_SIZE;
 
@@ -528,6 +525,9 @@ bool DoCommandP(TileIndex tile, uint32 p
 
	/* Flags get send to the DoCommand */
 
	uint32 flags = CommandFlagsToDCFlags(cmd_flags);
 

	
 
	/* Do not even think about executing out-of-bounds tile-commands */
 
	if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (cmd_flags & CMD_ALL_TILES) == 0))) return false;
 

	
 
	bool notest = (cmd_flags & CMD_NO_TEST) != 0;
 

	
 
	_docommand_recursive = 1;