diff --git a/src/micropolisj/engine/ExplosionSprite.java b/src/micropolisj/engine/ExplosionSprite.java index d36105a..ae77ffa 100644 --- a/src/micropolisj/engine/ExplosionSprite.java +++ b/src/micropolisj/engine/ExplosionSprite.java @@ -56,7 +56,7 @@ public class ExplosionSprite extends Sprite int t = z & LOMASK; if ((z & BURNBIT) == 0 && t != DIRT) return; - if ((z & ZONEBIT) != 0) + if (isZoneCenter(z)) return; city.setTile(xpos, ypos, (char)(FIRE + city.PRNG.nextInt(4) + ANIMBIT)); } diff --git a/src/micropolisj/engine/MapScanner.java b/src/micropolisj/engine/MapScanner.java index d88be18..8cc58e4 100644 --- a/src/micropolisj/engine/MapScanner.java +++ b/src/micropolisj/engine/MapScanner.java @@ -78,7 +78,7 @@ class MapScanner return; } - if ((cchr & ZONEBIT) != 0) + if (isZoneCenter(cchr)) { doZone(); return; @@ -192,7 +192,7 @@ class MapScanner int c = city.map[ytem][xtem]; if ((c & BURNBIT) != 0) { - if ((c & ZONEBIT) != 0) { + if (isZoneCenter(c)) { city.killZone(xtem, ytem, c); if ((c & LOMASK) > IZB) { //explode city.makeExplosion(xtem, ytem); @@ -234,7 +234,7 @@ class MapScanner if (((c & BURNBIT) != 0) || c == DIRT || (t >= WOODS5 && t < FLOOD)) { - if ((c & ZONEBIT) != 0) { + if (isZoneCenter(c)) { city.killZone(xx, yy, c); } city.setTile(xx, yy, (char)(FLOOD + PRNG.nextInt(3))); @@ -755,8 +755,9 @@ class MapScanner if (city.testBounds(xx, yy)) { int thCh = city.map[yy][xx]; - if ((thCh & ZONEBIT) != 0) + if (isZoneCenter(thCh)) { continue; + } if ((thCh & ANIMBIT) != 0) continue; diff --git a/src/micropolisj/engine/Micropolis.java b/src/micropolisj/engine/Micropolis.java index eda3bdd..c18e389 100644 --- a/src/micropolisj/engine/Micropolis.java +++ b/src/micropolisj/engine/Micropolis.java @@ -672,7 +672,7 @@ public class Micropolis for (int y = 0; y < height; y++) { char tile = map[y][x]; - if ((tile & ZONEBIT) != 0) + if (isZoneCenter(tile)) { tile &= LOMASK; int den = computePopDen(x, y, (char)tile) * 8; @@ -1838,8 +1838,9 @@ public class Micropolis continue; int t = map[y][x]; - if ((t & ZONEBIT) != 0) + if (isZoneCenter(t)) { continue; + } if ((t & BURNBIT) != 0 || t == DIRT) { setTile(x, y, RADTILE); } @@ -2212,7 +2213,7 @@ public class Micropolis int x = PRNG.nextInt(getWidth()); int y = PRNG.nextInt(getHeight()); int tile = map[y][x]; - if ((tile & ZONEBIT) == 0 && (tile & BURNBIT) != 0) + if (!isZoneCenter(tile) && (tile & BURNBIT) != 0) { tile &= LOMASK; if (tile > 21 && tile < LASTZONE) { diff --git a/src/micropolisj/engine/Sprite.java b/src/micropolisj/engine/Sprite.java index 6f105f0..a45423c 100644 --- a/src/micropolisj/engine/Sprite.java +++ b/src/micropolisj/engine/Sprite.java @@ -182,7 +182,7 @@ public abstract class Sprite if ((z & BURNBIT) == 0) { return; //cannot destroy it } - if ((z & ZONEBIT) != 0) { + if (isZoneCenter(z)) { city.killZone(xpos, ypos, z); if (t > RZB) { city.makeExplosion(xpos, ypos);