]> git.pond.sub.org Git - empserver/commitdiff
Update bmap when nuclear detonation makes wasteland
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 2 May 2010 17:19:08 +0000 (19:19 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 9 May 2010 07:08:04 +0000 (09:08 +0200)
detonate() tells the player the new sector designation (wasteland or
sea) when damage exceeds 100.  But it neglected to update the bmap.
Fix that.

src/lib/subs/detonate.c

index d695917f86c2c30de8a187e0686f6cdf341ddbcd..de8df182087b9de5f5d6e112d879c4434d7dddb6 100644 (file)
@@ -37,6 +37,7 @@
 #include "file.h"
 #include "land.h"
 #include "lost.h"
+#include "map.h"
 #include "misc.h"
 #include "nat.h"
 #include "news.h"
@@ -73,6 +74,7 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
     int rad;
     struct nstr_sect ns;
     struct nstr_item ni;
+    int changed = 0;
 
     mpr(bombown, "Releasing RV's for %s detonation...\n",
        airburst ? "airburst" : "groundburst");
@@ -125,6 +127,8 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
                sect.sct_type = SCT_WASTE;
                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 {
            sprintf(buf, "did %d%%%% damage in %%s\n", damage);
            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);
     while (nxtitem(&ni, &plane)) {
        if ((own = plane.pln_own) == 0)