]> granicus.if.org Git - nethack/commitdiff
fix B17001 - Still no "the guard disappears" message
authornethack.rankin <nethack.rankin>
Wed, 15 Jan 2003 21:25:02 +0000 (21:25 +0000)
committernethack.rankin <nethack.rankin>
Wed, 15 Jan 2003 21:25:02 +0000 (21:25 +0000)
     A change I made last August broke this; it was checking whether you
could see the guard after having removed him from the map.

src/vault.c

index a81322b1dc426842e569467ec7f03f45e81299cb..1c5409df52f798ff28d415db48cc06013064f1ed 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)vault.c    3.4     2002/11/06      */
+/*     SCCS Id: @(#)vault.c    3.4     2003/01/15      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -454,6 +454,8 @@ register struct monst *grd;
         long umoney = money_cnt(invent);
        register boolean u_carry_gold = ((umoney + hidden_gold()) > 0L);
 #endif
+       boolean see_guard;
+
        if(!on_level(&(egrd->gdlevel), &u.uz)) return(-1);
        nx = ny = m = n = 0;
        if(!u_in_vault && !grd_in_vault)
@@ -710,6 +712,7 @@ newpos:
 cleanup:
                x = grd->mx; y = grd->my;
 
+               see_guard = canspotmon(grd);
                wallify_vault(grd);
                remove_monster(grd->mx, grd->my);
                newsym(grd->mx,grd->my);
@@ -719,7 +722,7 @@ cleanup:
                restfakecorr(grd);
                if(!semi_dead && (in_fcorridor(grd, u.ux, u.uy) ||
                                     cansee(x, y))) {
-                   if (!disappear_msg_seen && canspotmon(grd))
+                   if (!disappear_msg_seen && see_guard)
                        pline("Suddenly, the %s disappears.", g_monnam(grd));
                    return(1);
                }