From fb6db46fdeec383716fcff115625a64049835624 Mon Sep 17 00:00:00 2001 From: "jason@long.name" <jason@long.name@d9718cc8-9f43-0410-858b-315f434eb58c> Date: Sun, 1 Sep 2013 00:26:44 +0000 Subject: [PATCH] tiles: remove old isIndustrialZone() function Note: this old Industrial Zone checking function would erroneously include the Coal power plant animated smoke. You could see this bug by selecting "industrial zones" for the overlay map, and looking closely where your coal power plants are. You will see that the coal power plant is invisible in the overlay except for the four tiles containing the smoke. git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@816 d9718cc8-9f43-0410-858b-315f434eb58c --- src/micropolisj/engine/TileConstants.java | 13 +++++-------- src/micropolisj/engine/Tiles.java | 4 +--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/micropolisj/engine/TileConstants.java b/src/micropolisj/engine/TileConstants.java index 1bea777..8afcd76 100644 --- a/src/micropolisj/engine/TileConstants.java +++ b/src/micropolisj/engine/TileConstants.java @@ -662,6 +662,11 @@ public class TileConstants (tile & LOMASK) < COMBASE; } + /** + * Checks whether the tile is defined with the "industrial-zone" attribute. + * Note: the old version of this function erroneously included the coal power + * plant smoke as an industrial zone. + */ public static boolean isIndustrialZone(int tile) { int tmp = tile & LOMASK; @@ -675,14 +680,6 @@ public class TileConstants return false; } - public static boolean isIndustrialZoneOld(int tile) - { - int tmp = tile & LOMASK; - return (tmp >= INDBASE && tmp < PORTBASE) - || (tmp >= SMOKEBASE && tmp < TINYEXP) - || (tmp >= SMOKEBASE2 && tmp < FOOTBALLGAME1); - } - public static boolean isResidentialClear(int tile) { return (tile & LOMASK) >= RESBASE && (tile & LOMASK) <= RESBASE+8; diff --git a/src/micropolisj/engine/Tiles.java b/src/micropolisj/engine/Tiles.java index aeeb55d..db334f6 100644 --- a/src/micropolisj/engine/Tiles.java +++ b/src/micropolisj/engine/Tiles.java @@ -105,9 +105,7 @@ public class Tiles static void checkTiles() { for (int i = 0; i < tiles.length; i++) { - if (TileConstants.isIndustrialZone(i) != TileConstants.isIndustrialZoneOld(i)) { - System.err.println("industrial zone disagreement: "+i); - } + // do something here } } }