Skip to content

Commit 2745ac2

Browse files
committed
Prevent building on burning oil.
Add a counter per map tile for fire effects, only clear the "is burning" bit when it is 0. This works only because the part that actually loaded effects from savegames vanished in 695cd8e, so we start with a clean slate after loading. Closes #1100.
1 parent a8d88d8 commit 2745ac2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/effects.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ static void killEffect(EFFECT *e)
268268
ASSERT(psTile, "Fire effect on non-existing tile (%d, %d)", posX, posY);
269269
if (psTile)
270270
{
271-
psTile->tileInfoBits &= ~BITS_ON_FIRE; // clear fire bit
271+
psTile->firecount--;
272+
if (psTile->firecount == 0)
273+
{
274+
psTile->tileInfoBits &= ~BITS_ON_FIRE; // clear fire bit
275+
}
272276
}
273277
}
274278
effectStatus[e-asEffectsList] = ES_INACTIVE;
@@ -2249,6 +2253,7 @@ void effectSetupFire(EFFECT *psEffect)
22492253
if (psTile)
22502254
{
22512255
psTile->tileInfoBits |= BITS_ON_FIRE;
2256+
psTile->firecount++;
22522257
}
22532258
psEffect->frameDelay = 300; // needs to be investigated...
22542259
psEffect->radius = auxVar; // needs to be investigated

src/map.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ typedef struct _maptile
9999
PIELIGHT colour;
100100
short limitedContinent; /** For land or sea limited propulsion types */
101101
short hoverContinent; /** For hover type propulsions */
102+
uint16_t firecount; // how many fire effects are on this tile?
102103

103104
// TYPE_OF_TERRAIN type; // The terrain type for the tile
104105
} MAPTILE;

0 commit comments

Comments
 (0)