]> granicus.if.org Git - nethack/commitdiff
redundant or inconsistent msleeping handling
authornethack.rankin <nethack.rankin>
Thu, 8 Feb 2007 05:04:33 +0000 (05:04 +0000)
committernethack.rankin <nethack.rankin>
Thu, 8 Feb 2007 05:04:33 +0000 (05:04 +0000)
     Eliminate some redundant monster sleep handling pointed out by <email deleted>.  I'm not sure if this is the right fix for mattackm(),
but the wakeup-after-hit was definitely wrong for the case where that hit
put the target to sleep.  (I didn't try to make that actually take place
but it is a possible outcome of monster-against-monster combat.)

src/mhitm.c
src/muse.c
src/wizard.c

index 4f2d3bca8e4683810479cf19a52e1acf7eb748ac..c4b43edb75e1fde9b08728c1f0ab469601c8c8d8 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mhitm.c    3.5     2006/08/07      */
+/*     SCCS Id: @(#)mhitm.c    3.5     2007/02/07      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -419,7 +419,7 @@ mattackm(magr, mdef)
                break;
 
            case AT_GAZE:
-               strike = 0;     /* will not wake up a sleeper */
+               strike = 0;
                res[i] = gazemm(magr, mdef, mattk);
                break;
 
@@ -463,13 +463,6 @@ mattackm(magr, mdef)
 
        if (res[i] & MM_DEF_DIED) return res[i];
 
-       /*
-        *  Wake up the defender.  NOTE:  this must follow the check
-        *  to see if the defender died.  We don't want to modify
-        *  unallocated monsters!
-        */
-       if (strike) mdef->msleeping = 0;
-
        if (res[i] & MM_AGR_DIED)  return res[i];
        /* return if aggressor can no longer attack */
        if (!magr->mcanmove || magr->msleeping) return res[i];
index a76421c6b1908e1e27d22ce1f3d4ba3091d9f9bc..f9e96b4a0b857e937716df814447c30208b3158e 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)muse.c     3.5     2006/04/17      */
+/*     SCCS Id: @(#)muse.c     3.5     2007/02/07      */
 /*     Copyright (C) 1990 by Ken Arromdee                         */
 /* NetHack may be freely redistributed.  See license for details.  */
 
@@ -1156,8 +1156,6 @@ register struct obj *otmp;
                                *in_rooms(mtmp->mx, mtmp->my, TEMPLE)) {
                            if (cansee(mtmp->mx, mtmp->my))
                                pline("%s resists the magic!", Monnam(mtmp));
-                           mtmp->msleeping = 0;
-                           if(mtmp->m_ap_type) seemimic(mtmp);
                        } else if (!tele_restrict(mtmp))
                            (void) rloc(mtmp, FALSE);
                }
index 6f0454915b41eb1f20854b75db3c64cb06f1ff98..71136e2cb7695acc44efd354f538258c36f0f3d4 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)wizard.c   3.5     2006/09/06      */
+/*     SCCS Id: @(#)wizard.c   3.5     2007/02/07      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -507,7 +507,7 @@ resurrect()
        }
 
        if (mtmp) {
-               mtmp->msleeping = mtmp->mtame = mtmp->mpeaceful = 0;
+               mtmp->mtame = mtmp->mpeaceful = 0;      /* paranoia */
                set_malign(mtmp);
                if (!Deaf) {
                    pline("A voice booms out...");