]> granicus.if.org Git - nethack/commitdiff
Wake up monsters, and let them stop eating, before angering them
authorAlex Smith <ais523@nethack4.org>
Tue, 20 Feb 2018 21:53:27 +0000 (21:53 +0000)
committerAlex Smith <ais523@nethack4.org>
Tue, 20 Feb 2018 21:53:27 +0000 (21:53 +0000)
If we do it the other way round, then mimics will forget what
they're mimicking without a seemimic() call, meaning that the
line-of-sight calculations can get confused if the mimic was
mimicking something opaque.

src/mon.c

index 62fb34a8f7b00dd7af3614dbe2e8afa6511b1677..7e82ba651b2cf7b0bb73d1442aecd2c35500a69f 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -2751,7 +2751,6 @@ boolean via_attack;
             }
         }
     }
-
 }
 
 /* wake up a monster, possibly making it angry in the process */
@@ -2761,9 +2760,6 @@ register struct monst *mtmp;
 boolean via_attack;
 {
     mtmp->msleeping = 0;
-    finish_meating(mtmp);
-    if (via_attack)
-        setmangry(mtmp, TRUE);
     if (mtmp->m_ap_type) {
         seemimic(mtmp);
     } else if (context.forcefight && !context.mon_moving
@@ -2771,6 +2767,9 @@ boolean via_attack;
         mtmp->mundetected = 0;
         newsym(mtmp->mx, mtmp->my);
     }
+    finish_meating(mtmp);
+    if (via_attack)
+        setmangry(mtmp, TRUE);
 }
 
 /* Wake up nearby monsters without angering them. */