diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 852ab6ce8..f690b1ec3 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -60,6 +60,10 @@ actually make the castle chest not trapped level-drain resistance wasn't shown during enlightenment if it was conferred by worn/wielded equipment wizard mode enlightenment now shows more reasons for various intrinsics +rehumanizing after being poly'd into vampire left hero with ability to sense + humans and elves +Warn_of_mon wouldn't have been able to sense giant ants if any creature were + to have that ability, caused by using 0 instead of NON_PM for 'none' Platform- and/or Interface-Specific Fixes diff --git a/src/cmd.c b/src/cmd.c index 9ed18debd..51fd17f70 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1450473780 2015/12/18 21:23:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.211 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1451082253 2015/12/25 22:24:13 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.212 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2040,7 +2040,7 @@ int final; : "certain monsters"); you_are(buf, ""); } - if (Warn_of_mon && context.warntype.speciesidx) { + if (Warn_of_mon && context.warntype.speciesidx >= LOW_PM) { Sprintf(buf, "aware of the presence of %s", makeplural(mons[context.warntype.speciesidx].mname)); you_are(buf, from_what(WARN_OF_MON)); diff --git a/src/polyself.c b/src/polyself.c index 4cd01d0d6..9cdc83be8 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 polyself.c $NHDT-Date: 1448496566 2015/11/26 00:09:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.104 $ */ +/* NetHack 3.6 polyself.c $NHDT-Date: 1451082254 2015/12/25 22:24:14 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.105 $ */ /* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -28,7 +28,7 @@ STATIC_DCL void FDECL(drop_weapon, (int)); STATIC_DCL void NDECL(uunstick); STATIC_DCL int FDECL(armor_to_dragon, (int)); STATIC_DCL void NDECL(newman); -STATIC_DCL boolean FDECL(polysense, (struct permonst *)); +STATIC_DCL void NDECL(polysense); STATIC_VAR const char no_longer_petrify_resistant[] = "No longer petrify-resistant, you"; @@ -100,6 +100,8 @@ set_uasmon() #ifdef STATUS_VIA_WINDOWPORT status_initialize(REASSESS_ONLY); #endif + + polysense(); } /* Levitation overrides Flying; set or clear BFlying|I_SPECIAL */ @@ -347,7 +349,6 @@ newman() Strcpy(killer.name, "unsuccessful polymorph"); done(DIED); newuhs(FALSE); - (void) polysense(youmonst.data); return; /* lifesaved */ } } @@ -362,7 +363,6 @@ newman() make_slimed(10L, (const char *) 0); } - (void) polysense(youmonst.data); context.botl = 1; see_monsters(); (void) encumber_msg(); @@ -827,7 +827,6 @@ int mntmp; u.utrap = 0; } check_strangling(TRUE); /* maybe start strangling */ - (void) polysense(youmonst.data); context.botl = 1; vision_full_recalc = 1; @@ -1777,20 +1776,18 @@ int atyp; } } -/* - * Some species have awareness of other species - */ -static boolean -polysense(mptr) -struct permonst *mptr; +/* some species have awareness of other species */ +static void +polysense() { - short warnidx = 0; + short warnidx = NON_PM; - context.warntype.speciesidx = 0; + context.warntype.speciesidx = NON_PM; context.warntype.species = 0; context.warntype.polyd = 0; + HWarn_of_mon &= ~FROMRACE; - switch (monsndx(mptr)) { + switch (u.umonnum) { case PM_PURPLE_WORM: warnidx = PM_SHRIEKER; break; @@ -1798,18 +1795,13 @@ struct permonst *mptr; case PM_VAMPIRE_LORD: context.warntype.polyd = M2_HUMAN | M2_ELF; HWarn_of_mon |= FROMRACE; - return TRUE; + return; } - if (warnidx) { + if (warnidx >= LOW_PM) { context.warntype.speciesidx = warnidx; context.warntype.species = &mons[warnidx]; HWarn_of_mon |= FROMRACE; - return TRUE; } - context.warntype.speciesidx = 0; - context.warntype.species = 0; - HWarn_of_mon &= ~FROMRACE; - return FALSE; } /*polyself.c*/ diff --git a/src/restore.c b/src/restore.c index d56af4ea6..509ff6ed9 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 restore.c $NHDT-Date: 1450231174 2015/12/16 01:59:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.102 $ */ +/* NetHack 3.6 restore.c $NHDT-Date: 1451082255 2015/12/25 22:24:15 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.103 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -531,7 +531,7 @@ unsigned int *stuckid, *steedid; return FALSE; } mread(fd, (genericptr_t) &context, sizeof(struct context_info)); - if (context.warntype.speciesidx) + if (context.warntype.speciesidx >= LOW_PM) context.warntype.species = &mons[context.warntype.speciesidx]; /* we want to be able to revert to command line/environment/config