]> granicus.if.org Git - nethack/commitdiff
R788 - bones corpses shouldn't all be human
authorcohrs <cohrs>
Wed, 24 Apr 2002 05:21:20 +0000 (05:21 +0000)
committercohrs <cohrs>
Wed, 24 Apr 2002 05:21:20 +0000 (05:21 +0000)
u.umonnum was used to create the corpse in a bones file.  However, unless
you're polymorphed and manage to actually die in that form, u.umonnum
refers to a role monster, which all have M2_HUMAN set, so they're all
human.  Even if the role monsters were mutated dynamically when the game
starts, the problem would still exist, just in a different form.
Use urace to determine the corpse type instead.

doc/fixes34.1
src/end.c

index 1409384a0287c86924a8b6ae21b8d9b868f377b7..36989334204d9b1dec15ca1968eed2a84cda2640 100644 (file)
@@ -91,6 +91,7 @@ monsters should not repeatedly try to teleport on noteleport levels
 crocodiles legs are not designed for kicking open doors, chests, et al.
 walls of one of the luckstone locations in minend-3 were diggable
 minetn-6 could place downstairs in a cut-off location
+corpses in bones files don't retain their role characteristic
 
 
 Platform- and/or Interface-Specific Fixes
index a62fe2901c7c1b795b7e9968d1dbbb91cd6f00f4..7cac2cbf4871ed1777cae5b05f21aaa0d52e46b8 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -646,7 +646,17 @@ die:
                u.ugrave_arise = (NON_PM - 1);  /* statue instead of corpse */
            else if (u.ugrave_arise == NON_PM &&
                     !(mvitals[u.umonnum].mvflags & G_NOCORPSE)) {
-               corpse = mk_named_object(CORPSE, &mons[u.umonnum],
+               int mnum = u.umonnum;
+
+               if (!Upolyd) {
+                   /* Base corpse on race when not poly'd since original
+                    * u.umonnum is based on role, and all role monsters
+                    * are human.
+                    */
+                   mnum = (flags.female && urace.femalenum != NON_PM) ?
+                       urace.femalenum : urace.malenum;
+               }
+               corpse = mk_named_object(CORPSE, &mons[mnum],
                                       u.ux, u.uy, plname);
                Sprintf(pbuf, "%s, %s%s", plname,
                        killer_format == NO_KILLER_PREFIX ? "" :