fix #H248 - 'speed monster' zap message not always necessary

From a bug report:  zapping wand
of speed monster (or slow monster) at an immobile monster would give the
usual '<mon> is moving faster" (or slower) message even though the monster
couldn't move at all.  This fixes that for monsters who can never move
and also for monsters who are temporarily paralyzed or asleep, although I
wonder whether speed change magic ought to also snap the latter out of it.
This commit is contained in:
nethack.rankin
2007-02-23 03:13:37 +00:00
parent c0418d52d6
commit bbee88dca3
2 changed files with 9 additions and 7 deletions

View File

@@ -327,6 +327,8 @@ can't #force floor item while engulfed, levitating, or unskilled riding
can't lock or unlock doors while engulfed can't lock or unlock doors while engulfed
if hero or monster standing on opened drawbridge survives its destruction, if hero or monster standing on opened drawbridge survives its destruction,
fall into water or lava instead of remaining on top fall into water or lava instead of remaining on top
don't give a speed change message when an immobile monster is seen to be hit
by a wand of speed or slow monster
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)worn.c 3.5 2005/11/27 */ /* SCCS Id: @(#)worn.c 3.5 2007/02/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -246,7 +246,10 @@ struct obj *obj; /* item to make known if effect can be seen */
else else
mon->mspeed = mon->permspeed; mon->mspeed = mon->permspeed;
if (give_msg && (mon->mspeed != oldspeed || petrify) && canseemon(mon)) { /* no message if monster is immobile (temp or perm) or unseen */
if (give_msg && (mon->mspeed != oldspeed || petrify) &&
mon->data->mmove && !(mon->mfrozen || mon->msleeping) &&
canseemon(mon)) {
/* fast to slow (skipping intermediate state) or vice versa */ /* fast to slow (skipping intermediate state) or vice versa */
const char *howmuch = (mon->mspeed + oldspeed == MFAST + MSLOW) ? const char *howmuch = (mon->mspeed + oldspeed == MFAST + MSLOW) ?
"much " : ""; "much " : "";
@@ -260,11 +263,8 @@ struct obj *obj; /* item to make known if effect can be seen */
else else
pline("%s seems to be moving %sslower.", Monnam(mon), howmuch); pline("%s seems to be moving %sslower.", Monnam(mon), howmuch);
/* might discover an object if we see the speed change happen, but /* might discover an object if we see the speed change happen */
avoid making possibly forgotten book known when casting its spell */ if (obj != 0) learnwand(obj);
if (obj != 0 && obj->dknown &&
objects[obj->otyp].oc_class != SPBOOK_CLASS)
makeknown(obj->otyp);
} }
} }