]> granicus.if.org Git - nethack/commitdiff
fix #H4272 - "you turn into a Elvenking"
authorPatR <rankin@nethack.org>
Thu, 10 Mar 2016 01:15:32 +0000 (17:15 -0800)
committerPatR <rankin@nethack.org>
Thu, 10 Mar 2016 01:15:32 +0000 (17:15 -0800)
Polyself with gender change into a creature with fixed gender
would deliver a message containing "a <creature>" regardless of
whether "an" was warranted.

(Into any creature which supports both genders it yielded
"a male <creature>" or "a female <creature>" so "an" was never
needed.  And when no gender change was involved, it used an()
so got "a <creature>" or "an <creature>" as applicable.)

doc/fixes36.1
src/polyself.c

index 8dd08e54618623339f483a23e5182ee6cb5fef0a..bb863eebbd9239c01057c56f8f43b2a2736d18aa 100644 (file)
@@ -184,6 +184,7 @@ wand/spell/breath zaps that reached the edge of the level on the Plane of Air
        and "vanished into the aether" left temporary display effects on screen
 stop amulets and other items which aren't affected by erosion damage from
        being subjected to erosion damage
+grammar bit: polyself w/ gender change yielded "you turn into a Elvenking"
 
 
 Platform- and/or Interface-Specific Fixes
index 9c03e5b8ddd1cf898d4e49d623ae62dab02d854c..b67cc133ad2c59dba52c7dcbab03bc30e5314174 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 polyself.c      $NHDT-Date: 1451082254 2015/12/25 22:24:14 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.105 $ */
+/* NetHack 3.6 polyself.c      $NHDT-Date: 1457572516 2016/03/10 01:15:16 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.108 $ */
 /*      Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -592,6 +592,7 @@ int
 polymon(mntmp)
 int mntmp;
 {
+    char buf[BUFSZ];
     boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
             was_blind = !!Blind, dochange = FALSE;
     int mlvl;
@@ -643,20 +644,16 @@ int mntmp;
         if (sex_change_ok && !rn2(10))
             dochange = TRUE;
     }
+
+    Strcpy(buf, (u.umonnum != mntmp) ? "" : "new ");
     if (dochange) {
         flags.female = !flags.female;
-        You("%s %s%s!",
-            (u.umonnum != mntmp) ? "turn into a" : "feel like a new",
-            (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
-                ? ""
-                : flags.female ? "female " : "male ",
-            mons[mntmp].mname);
-    } else {
-        if (u.umonnum != mntmp)
-            You("turn into %s!", an(mons[mntmp].mname));
-        else
-            You_feel("like a new %s!", mons[mntmp].mname);
+        Strcat(buf, (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
+                       ? "" : flags.female ? "female " : "male ");
     }
+    Strcat(buf, mons[mntmp].mname);
+    You("%s %s!", (u.umonnum != mntmp) ? "turn into" : "feel like", an(buf));
+
     if (Stoned && poly_when_stoned(&mons[mntmp])) {
         /* poly_when_stoned already checked stone golem genocide */
         mntmp = PM_STONE_GOLEM;
@@ -746,8 +743,6 @@ int mntmp;
         uunstick();
     if (u.usteed) {
         if (touch_petrifies(u.usteed->data) && !Stone_resistance && rnl(3)) {
-            char buf[BUFSZ];
-
             pline("%s touch %s.", no_longer_petrify_resistant,
                   mon_nam(u.usteed));
             Sprintf(buf, "riding %s", an(u.usteed->data->mname));