]> granicus.if.org Git - nethack/commitdiff
wizmgender: include corpstat gender in object name
authorMichael Meyer <me@entrez.cc>
Thu, 23 Jun 2022 16:10:03 +0000 (12:10 -0400)
committerPatR <rankin@nethack.org>
Sun, 3 Jul 2022 23:34:29 +0000 (16:34 -0700)
Add another use to wizmgender: when it is enabled, include the gender
specified in corpstat flags in the name of a statue, corpse, or
figurine, since it can influence various things but otherwise remains
invisible (for monsters without gendered names).  A little while ago
lichen corpses weren't stacking because, despite being a neuter monster,
the corpses they produced were being flagged as female or male; this
could be useful for debugging issues along those lines.

src/objnam.c

index ee223660a2c274d8a69306c3b9f2f68c4966d6f6..96a6e04efaed07d2148feda25423ce5939acdd4a 100644 (file)
@@ -1339,6 +1339,17 @@ doname_base(
         break;
     }
 
+    if ((obj->otyp == STATUE || obj->otyp == CORPSE || obj->otyp == FIGURINE)
+        && iflags.wizmgender) {
+        int cgend = (obj->spe & CORPSTAT_GENDER),
+            mgend = ((cgend == CORPSTAT_MALE) ? MALE
+                     : (cgend == CORPSTAT_FEMALE) ? FEMALE
+                       : NEUTRAL);
+        Sprintf(eos(bp), " (%s)",
+                cgend != CORPSTAT_RANDOM ? genders[mgend].adj
+                                         : "unspecified gender");
+    }
+
     if ((obj->owornmask & W_WEP) && !g.mrg_to_wielded) {
         boolean twoweap_primary = (obj == uwep && u.twoweap),
                 tethered = (obj->otyp == AKLYS);