]> granicus.if.org Git - nethack/commitdiff
avoid hallucinatory effect on black light as it explodes
authornethack.rankin <nethack.rankin>
Tue, 30 Nov 2004 04:32:01 +0000 (04:32 +0000)
committernethack.rankin <nethack.rankin>
Tue, 30 Nov 2004 04:32:01 +0000 (04:32 +0000)
     From a bug report:  when a black light explodes and triggers
hallucination, its own monster symbol--or warning marker for same--could
be seen changing.  Since nothing is left after it explodes, you shouldn't
hallucinate anything at its location.  Fix by killing it off (so removing
it from the map) before initiating Hallucination.

doc/fixes34.4
src/mhitu.c

index 9a7fa4dab59ce8399584aff90312c4464315c553..2c5fd96944b6ed8e71950b1daa2fc69d2c6a2507 100644 (file)
@@ -69,6 +69,7 @@ some types of shop theft of a stack of items only charged for a single one
 wizard mode: WIZKIT wish for own quest artifact triggered crash at startup
 avoid "your steed is still eating" message when going through a magic portal
 cannot drink from fountain, sink or surrounding water while swallowed
+don't hallucinate anything for an exploding black light as it dies
 
 
 Platform- and/or Interface-Specific Fixes
index fe60be78bc685f4b1c9788d0ca0610271e996acd..c0b3d2025c855a96c4bfb9046a436a2540b1f3d4 100644 (file)
@@ -1826,7 +1826,7 @@ register struct monst *mtmp;
 register struct attack  *mattk;
 boolean ufound;
 {
-    boolean physical_damage = TRUE;
+    boolean physical_damage = TRUE, kill_agr = TRUE;
 
     if (mtmp->mcan) return(0);
 
@@ -1890,6 +1890,9 @@ common:
                    boolean chg;
                    if (!Hallucination)
                        You("are caught in a blast of kaleidoscopic light!");
+                   /* avoid hallucinating the black light as it dies */
+                   mondead(mtmp);      /* remove it from map now */
+                   kill_agr = FALSE;   /* already killed (maybe lifesaved) */
                    chg = make_hallucinated(HHallucination + (long)tmp,FALSE,0L);
                    You("%s.", chg ? "are freaked out" : "seem unaffected");
                }
@@ -1903,10 +1906,9 @@ common:
            ugolemeffects((int)mattk->adtyp, tmp);
        }
     }
-    mondead(mtmp);
+    if (kill_agr) mondead(mtmp);
     wake_nearto(mtmp->mx, mtmp->my, 7*7);
-    if (mtmp->mhp > 0) return(0);
-    return(2); /* it dies */
+    return (mtmp->mhp > 0) ? 0 : 2;
 }
 
 int