diff --git a/include/extern.h b/include/extern.h index 272555670..f0b82a86f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2271,7 +2271,8 @@ E void FDECL(setworn, (struct obj *,long)); E void FDECL(setnotworn, (struct obj *)); E void FDECL(mon_set_minvis, (struct monst *)); E void FDECL(mon_adjust_speed, (struct monst *,int,struct obj *)); -E void FDECL(update_mon_intrinsics, (struct monst *,struct obj *,BOOLEAN_P)); +E void FDECL(update_mon_intrinsics, + (struct monst *,struct obj *,BOOLEAN_P,BOOLEAN_P)); E int FDECL(find_mac, (struct monst *)); E void FDECL(m_dowear, (struct monst *,BOOLEAN_P)); E struct obj *FDECL(which_armor, (struct monst *,long)); diff --git a/src/dog.c b/src/dog.c index 31089d2fc..29a749ab0 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)dog.c 3.4 2002/03/09 */ +/* SCCS Id: @(#)dog.c 3.4 2002/09/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -152,7 +152,7 @@ makedog() otmp->dknown = otmp->bknown = otmp->rknown = 1; otmp->owornmask = W_SADDLE; otmp->leashmon = mtmp->m_id; - update_mon_intrinsics(mtmp, otmp, TRUE); + update_mon_intrinsics(mtmp, otmp, TRUE, TRUE); } #endif diff --git a/src/mhitm.c b/src/mhitm.c index 1768b45fe..1d5d81b19 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mhitm.c 3.4 2002/02/17 */ +/* SCCS Id: @(#)mhitm.c 3.4 2002/09/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -991,7 +991,7 @@ label2: if (mdef->mhp > 0) return 0; if (otmp->owornmask & W_WEP) setmnotwielded(mdef,otmp); otmp->owornmask = 0L; - update_mon_intrinsics(mdef, otmp, FALSE); + update_mon_intrinsics(mdef, otmp, FALSE, FALSE); } /* add_to_minv() might free otmp [if it merges] */ if (vis) diff --git a/src/mon.c b/src/mon.c index 34627fde1..6d255d13c 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1559,13 +1559,8 @@ register struct monst *mdef; /* some objects may end up outside the statue */ while ((obj = mdef->minvent) != 0) { obj_extract_self(obj); - if (obj->owornmask) { - /* don't want map updates if invisibility - toggles or messages if speed changes */ - in_mklev = TRUE; - update_mon_intrinsics(mdef, obj, FALSE); - in_mklev = FALSE; - } + if (obj->owornmask) + update_mon_intrinsics(mdef, obj, FALSE, TRUE); obj_no_longer_held(obj); if (obj->owornmask & W_WEP) setmnotwielded(mdef,obj); diff --git a/src/mthrowu.c b/src/mthrowu.c index 4246a1f1d..b2a979aac 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mthrowu.c 3.4 2002/07/23 */ +/* SCCS Id: @(#)mthrowu.c 3.4 2002/09/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -492,7 +492,7 @@ struct obj *obj; possibly_unwield(mon); if (obj->owornmask) { mon->misc_worn_check &= ~obj->owornmask; - update_mon_intrinsics(mon, obj, FALSE); + update_mon_intrinsics(mon, obj, FALSE, FALSE); } obfree(obj, (struct obj*) 0); } diff --git a/src/pickup.c b/src/pickup.c index 7e4ce48c0..0e6ec20fa 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)pickup.c 3.4 2002/08/21 */ +/* SCCS Id: @(#)pickup.c 3.4 2002/09/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1614,7 +1614,7 @@ boolean *prev_loot; if ((unwornmask = otmp->owornmask) != 0L) { mtmp->misc_worn_check &= ~unwornmask; otmp->owornmask = 0L; - update_mon_intrinsics(mtmp, otmp, FALSE); + update_mon_intrinsics(mtmp, otmp, FALSE, FALSE); } otmp = hold_another_object(otmp, "You drop %s!", doname(otmp), (const char *)0); diff --git a/src/steal.c b/src/steal.c index a65a54549..cd0bf54d4 100644 --- a/src/steal.c +++ b/src/steal.c @@ -554,13 +554,8 @@ boolean is_pet; /* If true, pet should keep wielded/worn items */ costly_spot(mtmp->mx, mtmp->my)) otmp->no_charge = 1; #endif - if (otmp->owornmask) { - /* don't want map updates if invisibility - toggles or messages if speed changes */ - in_mklev = TRUE; - update_mon_intrinsics(mtmp, otmp, FALSE); - in_mklev = FALSE; - } + if (otmp->owornmask) + update_mon_intrinsics(mtmp, otmp, FALSE, TRUE); /* obj_no_longer_held(otmp); -- done by place_object */ if (otmp->owornmask & W_WEP) setmnotwielded(mtmp, otmp); diff --git a/src/steed.c b/src/steed.c index 38e891272..a2b8d0409 100644 --- a/src/steed.c +++ b/src/steed.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)steed.c 3.4 2002/05/31 */ +/* SCCS Id: @(#)steed.c 3.4 2002/09/08 */ /* Copyright (c) Kevin Hugo, 1998-1999. */ /* NetHack may be freely redistributed. See license for details. */ @@ -139,7 +139,7 @@ use_saddle(otmp) mtmp->misc_worn_check |= W_SADDLE; otmp->owornmask = W_SADDLE; otmp->leashmon = mtmp->m_id; - update_mon_intrinsics(mtmp, otmp, TRUE); + update_mon_intrinsics(mtmp, otmp, TRUE, FALSE); } else pline("%s resists!", Monnam(mtmp)); return 1; diff --git a/src/uhitm.c b/src/uhitm.c index bedf1733e..63fd5ac2c 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)uhitm.c 3.4 2002/08/21 */ +/* SCCS Id: @(#)uhitm.c 3.4 2002/09/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1134,7 +1134,7 @@ struct attack *mattk; MON_NOWEP(mdef); } otmp->owornmask = 0L; - update_mon_intrinsics(mdef, otmp, FALSE); + update_mon_intrinsics(mdef, otmp, FALSE, FALSE); if (otmp == stealoid) /* special message for final item */ pline("%s finishes taking off %s suit.", diff --git a/src/worn.c b/src/worn.c index 7f8fc8798..1e646aa88 100644 --- a/src/worn.c +++ b/src/worn.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)worn.c 3.4 2002/08/30 */ +/* SCCS Id: @(#)worn.c 3.4 2002/09/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -208,10 +208,10 @@ struct obj *obj; /* item to make known if effect can be seen */ /* armor put on or taken off; might be magical variety */ void -update_mon_intrinsics(mon, obj, on) +update_mon_intrinsics(mon, obj, on, silently) struct monst *mon; struct obj *obj; -boolean on; +boolean on, silently; { int unseen; uchar mask; @@ -227,8 +227,13 @@ boolean on; mon->minvis = !mon->invis_blkd; break; case FAST: + { + boolean save_in_mklev = in_mklev; + if (silently) in_mklev = TRUE; mon_adjust_speed(mon, 0, obj); + in_mklev = save_in_mklev; break; + } /* properties handled elsewhere */ case ANTIMAGIC: case REFLECTING: @@ -262,8 +267,13 @@ boolean on; mon->minvis = mon->perminvis; break; case FAST: + { + boolean save_in_mklev = in_mklev; + if (silently) in_mklev = TRUE; mon_adjust_speed(mon, 0, obj); + in_mklev = save_in_mklev; break; + } case FIRE_RES: case COLD_RES: case SLEEP_RES: @@ -310,7 +320,7 @@ boolean on; #endif /* if couldn't see it but now can, or vice versa, update display */ - if (unseen ^ !canseemon(mon)) + if (!silently && (unseen ^ !canseemon(mon))) newsym(mon->mx, mon->my); } @@ -474,10 +484,10 @@ outer_break: if (mon->mfrozen) mon->mcanmove = 0; } if (old) - update_mon_intrinsics(mon, old, FALSE); + update_mon_intrinsics(mon, old, FALSE, creation); mon->misc_worn_check |= flag; best->owornmask |= flag; - update_mon_intrinsics(mon, best, TRUE); + update_mon_intrinsics(mon, best, TRUE, creation); } struct obj * @@ -499,8 +509,9 @@ struct monst *mon; struct obj *obj; { mon->misc_worn_check &= ~obj->owornmask; + if (obj->owornmask) + update_mon_intrinsics(mon, obj, FALSE, FALSE); obj->owornmask = 0L; - update_mon_intrinsics(mon, obj, FALSE); obj_extract_self(obj); place_object(obj, mon->mx, mon->my); diff --git a/src/zap.c b/src/zap.c index bab3b5a02..8995e9abf 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)zap.c 3.4 2002/07/23 */ +/* SCCS Id: @(#)zap.c 3.4 2002/09/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -244,8 +244,8 @@ struct obj *otmp; #ifdef STEED } else if (!!(obj = which_armor(mtmp, W_SADDLE))) { mtmp->misc_worn_check &= ~obj->owornmask; + update_mon_intrinsics(mtmp, obj, FALSE, FALSE); obj->owornmask = 0L; - update_mon_intrinsics(mtmp, obj, FALSE); obj_extract_self(obj); place_object(obj, mtmp->mx, mtmp->my); /* call stackobj() if we ever drop anything that can merge */