From 1da609a5ce5b591586f025f9b07ce33a09d476bc Mon Sep 17 00:00:00 2001 From: "jason@long.name" Date: Wed, 20 Feb 2013 02:04:58 +0000 Subject: [PATCH] coalsmoke: when coal plant blows up, stop its smoke animation git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@567 d9718cc8-9f43-0410-858b-315f434eb58c --- src/micropolisj/engine/Micropolis.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/micropolisj/engine/Micropolis.java b/src/micropolisj/engine/Micropolis.java index 7d6a934..7b6096d 100644 --- a/src/micropolisj/engine/Micropolis.java +++ b/src/micropolisj/engine/Micropolis.java @@ -2366,14 +2366,24 @@ public class Micropolis rateOGMem[ypos/8][xpos/8] -= 20; int sz = TileConstants.getZoneSizeFor(zoneTile); - for (int x = 0; x < sz; x++) { - for (int y = 0; y < sz; y++) { + int zoneBase = (zoneTile&LOMASK)-1-sz; + + for (int y = 0; y < sz; y++) { + for (int x = 0; x < sz; x++, zoneBase++) { int xtem = xpos - 1 + x; int ytem = ypos - 1 + y; if (!testBounds(xtem, ytem)) continue; int t = getTile(xtem, ytem); + if ((zoneTile & LOMASK) == POWERPLANT && + (t & LOMASK) >= COALSMOKE1 && + (t & LOMASK) < COALSMOKE4+4) { + // animated coal smoke + setTile(xtem, ytem, (char)(zoneBase | CONDBIT | BULLBIT)); + continue; + } + if ((t & LOMASK) >= ROADBASE) { setTile(xtem, ytem, (char)(t | BULLBIT)); }