summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-05-19 01:51:57 +0000
committerbelugas <belugas@openttd.org>2008-05-19 01:51:57 +0000
commitcbd034925121799d0dca893f10bade0200ef3d6c (patch)
tree4339f3c8da5f4dd5e81e11aab64a6025e6b9baaa
parent290cedade22ae5e5f5fb52dfedea6ec5101ba9d2 (diff)
downloadopenttd-cbd034925121799d0dca893f10bade0200ef3d6c.tar.xz
(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
-rw-r--r--src/terraform_cmd.cpp3
-rw-r--r--src/terraform_gui.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp
index a71dfe21a..f35fb8bd5 100644
--- a/src/terraform_cmd.cpp
+++ b/src/terraform_cmd.cpp
@@ -301,7 +301,10 @@ CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
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;
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 9b6c5d6b9..44d112eb3 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -347,8 +347,6 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode)
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 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode)
}
} END_TILE_LOOP(tile2, sizex, sizey, tile)
}
-
- _generating_world = false;
}
static void PlaceProc_RaiseBigLand(TileIndex tile)