]> granicus.if.org Git - nethack/commitdiff
\#wizborn fix
authorPatR <rankin@nethack.org>
Tue, 25 Oct 2022 20:58:26 +0000 (13:58 -0700)
committerPatR <rankin@nethack.org>
Tue, 25 Oct 2022 20:58:26 +0000 (13:58 -0700)
The #wizborn command shows 'E' for an extinct species and 'G' for a
genocided one, but if a species first becomes extinct and then later
gets genocided, instead of showing both flags it stopped showing
either.  I was going to add a second flag column and show 'E' and 'G'
separately but decided to stick with one column and display 'X' for
the unlikely 'both extinct and genocided' case.

src/insight.c

index 8ae7b0b8d9ad3fde57018c8ec5cb9a99dd5ff667..ad5521531fe7561747c4da6f558765bc32765cc3 100644 (file)
@@ -2635,11 +2635,13 @@ doborn(void)
     putstr(datawin, 0, "died born");
     for (i = LOW_PM; i < NUMMONS; i++)
         if (g.mvitals[i].born || g.mvitals[i].died
-            || (g.mvitals[i].mvflags & G_GONE)) {
+            || (g.mvitals[i].mvflags & G_GONE) != 0) {
             Sprintf(buf, fmt,
                     g.mvitals[i].died, g.mvitals[i].born,
-                    ((g.mvitals[i].mvflags & G_GONE) == G_EXTINCT) ? 'E' :
-                    ((g.mvitals[i].mvflags & G_GONE) == G_GENOD) ? 'G' : ' ',
+                    ((g.mvitals[i].mvflags & G_GONE) == G_EXTINCT) ? 'E'
+                    : ((g.mvitals[i].mvflags & G_GONE) == G_GENOD) ? 'G'
+                      : ((g.mvitals[i].mvflags & G_GONE) != 0) ? 'X'
+                        : ' ',
                     mons[i].pmnames[NEUTRAL]);
             putstr(datawin, 0, buf);
             nborn += g.mvitals[i].born;
@@ -2676,8 +2678,10 @@ list_vanquished(char defquery, boolean ask)
     boolean dumping; /* for DUMPLOG; doesn't need to be conditional */
 
     dumping = (defquery == 'd');
-    if (dumping)
+    if (dumping) {
         defquery = 'y';
+        ask = FALSE; /* redundant; caller passes False with defquery=='d' */
+    }
 
     /* get totals first */
     ntypes = 0;