changeset 11092:3ff2dacbbc5e draft

(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
author belugas <belugas@openttd.org>
date Tue, 10 Feb 2009 00:50:04 +0000
parents c4c35a89bad7
children 1d2655421ce9
files src/unmovable_cmd.cpp
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -391,7 +391,7 @@
 	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 @@
 		}
 	}
 
-	if (_settings_game.game_creation.landscape == LT_TROPIC) return;
-
 	/* add lighthouses */
 	uint maxx = MapMaxX();
 	uint maxy = MapMaxY();