(svn r13177) -Fix[FS#2002]: Using level tool in scenario editor makes tiles brown. That is the only tool that does so in Scenario Editor (apart dynamite, of course).Report and Fix by Roujin
authorbelugas
Mon, 19 May 2008 01:51:57 +0000
changeset 9309 7e9af4c58963
parent 9308 b2c24e2cdb7d
child 9310 d2f150a6e2f0
(svn r13177) -Fix[FS#2002]: Using level tool in scenario editor makes tiles brown. That is the only tool that does so in Scenario Editor (apart dynamite, of course).Report and Fix by Roujin
src/terraform_cmd.cpp
src/terraform_gui.cpp
--- a/src/terraform_cmd.cpp	Mon May 19 01:50:07 2008 +0000
+++ b/src/terraform_cmd.cpp	Mon May 19 01:51:57 2008 +0000
@@ -301,7 +301,10 @@
 				return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE);
 			}
 			/* Check tiletype-specific things, and add extra-cost */
+			const bool curr_gen = _generating_world;
+			if (_game_mode == GM_EDITOR) _generating_world = true; // used to create green terraformed land
 			CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, tileh);
+			_generating_world = curr_gen;
 			if (CmdFailed(cost)) {
 				_terraform_err_tile = tile;
 				return cost;
--- a/src/terraform_gui.cpp	Mon May 19 01:50:07 2008 +0000
+++ b/src/terraform_gui.cpp	Mon May 19 01:51:57 2008 +0000
@@ -347,8 +347,6 @@
 	int sizex, sizey;
 	uint h;
 
-	_generating_world = true; // used to create green terraformed land
-
 	if (_terraform_size == 1) {
 		StringID msg =
 			mode ? STR_0808_CAN_T_RAISE_LAND_HERE : STR_0809_CAN_T_LOWER_LAND_HERE;
@@ -384,8 +382,6 @@
 			}
 		} END_TILE_LOOP(tile2, sizex, sizey, tile)
 	}
-
-	_generating_world = false;
 }
 
 static void PlaceProc_RaiseBigLand(TileIndex tile)