Codechange: Untangle command code, flags and error string for DoCommand*.
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
void CcTerraform(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
|
||||
void CcTerraform(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd)
|
||||
{
|
||||
if (result.Succeeded()) {
|
||||
if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile);
|
||||
@@ -115,16 +115,16 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t
|
||||
|
||||
switch (proc) {
|
||||
case DDSP_DEMOLISH_AREA:
|
||||
DoCommandP(CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed ? 1 : 0);
|
||||
DoCommandP(CMD_CLEAR_AREA, STR_ERROR_CAN_T_CLEAR_THIS_AREA, CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed ? 1 : 0);
|
||||
break;
|
||||
case DDSP_RAISE_AND_LEVEL_AREA:
|
||||
DoCommandP(CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_RAISE_LAND_HERE), CcTerraform, end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0));
|
||||
DoCommandP(CMD_LEVEL_LAND, STR_ERROR_CAN_T_RAISE_LAND_HERE, CcTerraform, end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0));
|
||||
break;
|
||||
case DDSP_LOWER_AND_LEVEL_AREA:
|
||||
DoCommandP(CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LOWER_LAND_HERE), CcTerraform, end_tile, start_tile, LM_LOWER << 1 | (_ctrl_pressed ? 1 : 0));
|
||||
DoCommandP(CMD_LEVEL_LAND, STR_ERROR_CAN_T_LOWER_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LOWER << 1 | (_ctrl_pressed ? 1 : 0));
|
||||
break;
|
||||
case DDSP_LEVEL_AREA:
|
||||
DoCommandP(CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LEVEL_LAND_HERE), CcTerraform, end_tile, start_tile, LM_LEVEL << 1 | (_ctrl_pressed ? 1 : 0));
|
||||
DoCommandP(CMD_LEVEL_LAND, STR_ERROR_CAN_T_LEVEL_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LEVEL << 1 | (_ctrl_pressed ? 1 : 0));
|
||||
break;
|
||||
case DDSP_CREATE_ROCKS:
|
||||
GenerateRockyArea(end_tile, start_tile);
|
||||
@@ -238,7 +238,7 @@ struct TerraformToolbarWindow : Window {
|
||||
break;
|
||||
|
||||
case WID_TT_BUY_LAND: // Buy land button
|
||||
DoCommandP(CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0);
|
||||
DoCommandP(CMD_BUILD_OBJECT, STR_ERROR_CAN_T_PURCHASE_THIS_LAND, CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0);
|
||||
break;
|
||||
|
||||
case WID_TT_PLACE_SIGN: // Place sign button
|
||||
@@ -395,7 +395,7 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode)
|
||||
StringID msg =
|
||||
mode ? STR_ERROR_CAN_T_RAISE_LAND_HERE : STR_ERROR_CAN_T_LOWER_LAND_HERE;
|
||||
|
||||
DoCommandP(CMD_TERRAFORM_LAND | CMD_MSG(msg), CcTerraform, tile, SLOPE_N, (uint32)mode);
|
||||
DoCommandP(CMD_TERRAFORM_LAND, msg, CcTerraform, tile, SLOPE_N, (uint32)mode);
|
||||
} else {
|
||||
assert(_terraform_size != 0);
|
||||
TileArea ta(tile, _terraform_size, _terraform_size);
|
||||
|
Reference in New Issue
Block a user