(svn r5398) Rename checkRadioTowerNearby() to IsRadioTowerNearby() and flip its return value to make it a bit less ambiguous
authortron
Wed, 28 Jun 2006 06:17:41 +0000
changeset 4083 09ca2e8a41ea
parent 4082 6a21544873f0
child 4084 318905f3d768
(svn r5398) Rename checkRadioTowerNearby() to IsRadioTowerNearby() and flip its return value to make it a bit less ambiguous
unmovable_cmd.c
--- a/unmovable_cmd.c	Wed Jun 28 06:12:23 2006 +0000
+++ b/unmovable_cmd.c	Wed Jun 28 06:17:41 2006 +0000
@@ -297,14 +297,14 @@
 
 
 /* checks, if a radio tower is within a 9x9 tile square around tile */
-static bool checkRadioTowerNearby(TileIndex tile)
+static bool IsRadioTowerNearby(TileIndex tile)
 {
 	TileIndex tile_s = tile - TileDiffXY(4, 4);
 
 	BEGIN_TILE_LOOP(tile, 9, 9, tile_s)
-		if (IsTransmitterTile(tile)) return false;
+		if (IsTransmitterTile(tile)) return true;
 	END_TILE_LOOP(tile, 9, 9, tile_s)
-	return true;
+	return false;
 }
 
 void GenerateUnmovables(void)
@@ -323,7 +323,7 @@
 	do {
 		tile = RandomTile();
 		if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h >= TILE_HEIGHT * 4) {
-			if (!checkRadioTowerNearby(tile)) continue;
+			if (IsRadioTowerNearby(tile)) continue;
 			MakeTransmitter(tile);
 			if (--j == 0) break;
 		}