1
0
Fork 0

(svn r11168) -Fix [FS#1256]: assert on terraforming of industries. Patch by frosch.

release/0.6
rubidium 2007-09-26 14:14:51 +00:00
parent 93459d1b43
commit ca7cab0253
2 changed files with 3 additions and 2 deletions

View File

@ -314,7 +314,7 @@ CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE); return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE);
} }
/* Check tiletype-specific things, and add extra-cost */ /* Check tiletype-specific things, and add extra-cost */
CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags, z_min * TILE_HEIGHT, (Slope) tileh); CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, (Slope) tileh);
if (CmdFailed(cost)) { if (CmdFailed(cost)) {
_terraform_err_tile = tile; _terraform_err_tile = tile;
return cost; return cost;

View File

@ -385,6 +385,7 @@ static CommandCost ClearTile_Industry(TileIndex tile, byte flags)
*/ */
if ((_current_player != OWNER_WATER && _game_mode != GM_EDITOR && if ((_current_player != OWNER_WATER && _game_mode != GM_EDITOR &&
!_cheats.magic_bulldozer.value) || !_cheats.magic_bulldozer.value) ||
((flags & DC_AUTO) != 0) ||
(_current_player == OWNER_WATER && (indspec->behaviour & INDUSTRYBEH_BUILT_ONWATER))) { (_current_player == OWNER_WATER && (indspec->behaviour & INDUSTRYBEH_BUILT_ONWATER))) {
SetDParam(0, indspec->name); SetDParam(0, indspec->name);
return_cmd_error(STR_4800_IN_THE_WAY); return_cmd_error(STR_4800_IN_THE_WAY);
@ -2019,7 +2020,7 @@ static CommandCost TerraformTile_Industry(TileIndex tile, uint32 flags, uint z_n
} }
} }
} }
return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); // funny magic bulldozer return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
} }
extern const TileTypeProcs _tile_type_industry_procs = { extern const TileTypeProcs _tile_type_industry_procs = {