Update bmap when nuclear detonation makes wasteland

detonate() tells the player the new sector designation (wasteland or
sea) when damage exceeds 100.  But it neglected to update the bmap.
Fix that.
This commit is contained in:
Markus Armbruster 2010-05-02 19:19:08 +02:00
parent b97d0c625e
commit 265bd0c56b

View file

@ -37,6 +37,7 @@
#include "file.h" #include "file.h"
#include "land.h" #include "land.h"
#include "lost.h" #include "lost.h"
#include "map.h"
#include "misc.h" #include "misc.h"
#include "nat.h" #include "nat.h"
#include "news.h" #include "news.h"
@ -73,6 +74,7 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
int rad; int rad;
struct nstr_sect ns; struct nstr_sect ns;
struct nstr_item ni; struct nstr_item ni;
int changed = 0;
mpr(bombown, "Releasing RV's for %s detonation...\n", mpr(bombown, "Releasing RV's for %s detonation...\n",
airburst ? "airburst" : "groundburst"); airburst ? "airburst" : "groundburst");
@ -125,6 +127,8 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
sect.sct_type = SCT_WASTE; sect.sct_type = SCT_WASTE;
bp = "turned %s into a radioactive wasteland\n"; bp = "turned %s into a radioactive wasteland\n";
} }
changed |= map_set(player->cnum, sect.sct_x, sect.sct_y,
dchr[sect.sct_type].d_mnem, 0);
} else { } else {
sprintf(buf, "did %d%%%% damage in %%s\n", damage); sprintf(buf, "did %d%%%% damage in %%s\n", damage);
bp = buf; bp = buf;
@ -139,6 +143,9 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
} }
} }
if (changed)
writebmap(player->cnum);
snxtitem_dist(&ni, EF_PLANE, x, y, rad); snxtitem_dist(&ni, EF_PLANE, x, y, rad);
while (nxtitem(&ni, &plane)) { while (nxtitem(&ni, &plane)) {
if ((own = plane.pln_own) == 0) if ((own = plane.pln_own) == 0)