]> granicus.if.org Git - nethack/commitdiff
fix #H363 - reviving corpses of hiding monsters (trunk only)
authornethack.rankin <nethack.rankin>
Thu, 31 May 2007 01:42:48 +0000 (01:42 +0000)
committernethack.rankin <nethack.rankin>
Thu, 31 May 2007 01:42:48 +0000 (01:42 +0000)
     From a bug report, reviving a snake corpse
produced a snake monster which was hidden under nothing--it hid under its
own corpse and wasn't revealed when that corpse got used up.  Rather than
fiddling with sequencing to remove the corpse before making the monster,
force any monster who revives in hidden state to unhide.

doc/fixes35.0
src/zap.c

index 57ce2f6be009c1f43ea917e504a1432594560f61..5b5df3dedd15604998f7c2c3a761d75068e1544d 100644 (file)
@@ -239,6 +239,8 @@ attacking via applied polearm now honors the "confirm" option
 engulfer under influence of conflict or confusion could swallow monster at
        water/lava/trap spot and not be affected by destination til next move
 unicorn horn restoration no longer overrides sustain ability characteristic
+hider monster revived from corpse would start out hidden (even if own corpse
+       was only object around to hide under)
 
 
 Platform- and/or Interface-Specific Fixes
index 44ca8112c79ff619cb8ec1ba420ff6bfff26524f..9b0d334fdcd573db9b41bcc158a724632d080967 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)zap.c      3.5     2007/03/30      */
+/*     SCCS Id: @(#)zap.c      3.5     2007/05/30      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -739,6 +739,13 @@ boolean by_hero;
     }
     if (!mtmp) return (struct monst *)0;
 
+    /* hiders shouldn't already be re-hidden when they revive */
+    if (mtmp->mundetected) {
+       mtmp->mundetected = 0;
+       newsym(mtmp->mx, mtmp->my);
+    }
+    if (mtmp->m_ap_type) seemimic(mtmp);
+
     /* if this is caused by the hero there might be a shop charge */
     if (by_hero) {
        struct monst *shkp = 0;