(svn r11168) -Fix [FS#1256]: assert on terraforming of industries. Patch by frosch.
authorrubidium
Wed, 26 Sep 2007 14:14:51 +0000
changeset 7637 43e2956af72e
parent 7636 ec035c803c21
child 7638 5f374c09da52
(svn r11168) -Fix [FS#1256]: assert on terraforming of industries. Patch by frosch.
src/clear_cmd.cpp
src/industry_cmd.cpp
--- a/src/clear_cmd.cpp	Wed Sep 26 14:05:09 2007 +0000
+++ b/src/clear_cmd.cpp	Wed Sep 26 14:14:51 2007 +0000
@@ -314,7 +314,7 @@
 				return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE);
 			}
 			/* 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)) {
 				_terraform_err_tile = tile;
 				return cost;
--- a/src/industry_cmd.cpp	Wed Sep 26 14:05:09 2007 +0000
+++ b/src/industry_cmd.cpp	Wed Sep 26 14:14:51 2007 +0000
@@ -385,6 +385,7 @@
 	 */
 	if ((_current_player != OWNER_WATER && _game_mode != GM_EDITOR &&
 			!_cheats.magic_bulldozer.value) ||
+			((flags & DC_AUTO) != 0) ||
 			(_current_player == OWNER_WATER && (indspec->behaviour & INDUSTRYBEH_BUILT_ONWATER))) {
 		SetDParam(0, indspec->name);
 		return_cmd_error(STR_4800_IN_THE_WAY);
@@ -2019,7 +2020,7 @@
 			}
 		}
 	}
-	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 = {