summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2009-02-10 00:50:04 +0000
committerbelugas <belugas@openttd.org>2009-02-10 00:50:04 +0000
commitda9783aaf7cbfe0895e8d57e278e5a21fa97f470 (patch)
tree3a53ea2ddbb26b0dc129ef21ec47a74e5c412353
parentad30a3c4caaad54f1b0b279bb0fc78254016efe3 (diff)
downloadopenttd-da9783aaf7cbfe0895e8d57e278e5a21fa97f470.tar.xz
(svn r15437) -Codechange: Do not run a code section when you already know it is useless
-Codechange: Do not rely on a decision based on something that has already been evaluated
-rw-r--r--src/unmovable_cmd.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index 6e86db8ff..4b7eea254 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -391,7 +391,7 @@ void GenerateUnmovables()
int lighthouses_to_build = _settings_game.game_creation.landscape == LT_TROPIC ? 0 : ScaleByMapSize1D((Random() & 3) + 7);
/* Scale the amount of lighthouses with the amount of land at the borders. */
- if (_settings_game.construction.freeform_edges) {
+ if (_settings_game.construction.freeform_edges && lighthouses_to_build != 0) {
uint num_water_tiles = 0;
for (uint x = 0; x < MapMaxX(); x++) {
if (IsTileType(TileXY(x, 1), MP_WATER)) num_water_tiles++;
@@ -421,8 +421,6 @@ void GenerateUnmovables()
}
}
- if (_settings_game.game_creation.landscape == LT_TROPIC) return;
-
/* add lighthouses */
uint maxx = MapMaxX();
uint maxy = MapMaxY();