From aadacd9210f17d1407dd610493329c99aa0fb09c Mon Sep 17 00:00:00 2001 From: "jason@long.name" Date: Wed, 20 Feb 2013 02:04:51 +0000 Subject: [PATCH] coalplant- do not eliminate fire when animating smoke This changes the behavior of a coal plant on fire. Previously, if the smoke tiles were on fire when the coal plant is activated, the coalSmoke() function would replace the fire tiles with the animated smoke. Now, the animated smoke tiles are only set when the tiles are the original coal plant tiles. Fire needs to burn itself out, the rubble must be bulldozed, then the plant must call repairZone() for itself, and only then will the animated smoke be added back in. git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@566 d9718cc8-9f43-0410-858b-315f434eb58c --- src/micropolisj/engine/MapScanner.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/micropolisj/engine/MapScanner.java b/src/micropolisj/engine/MapScanner.java index 41c111b..829905a 100644 --- a/src/micropolisj/engine/MapScanner.java +++ b/src/micropolisj/engine/MapScanner.java @@ -1337,9 +1337,12 @@ class MapScanner final int [] dy = { -1, -1, 0, 0 }; for (int z = 0; z < 4; z++) { - city.setTile(xpos + dx[z], ypos + dy[z], - (char) (SmTb[z] | ANIMBIT | CONDBIT | PWRBIT | BURNBIT) - ); + int tile = city.getTile(xpos+dx[z], ypos+dy[z]) & LOMASK; + if (tile >= COALBASE && tile < COALBASE + 4*4) { + city.setTile(xpos + dx[z], ypos + dy[z], + (char) (SmTb[z] | ANIMBIT | CONDBIT | PWRBIT | BURNBIT) + ); + } } }