]> granicus.if.org Git - nethack/commitdiff
monster ranged attacks (trunk only)
authornethack.rankin <nethack.rankin>
Sun, 28 Jan 2007 02:20:40 +0000 (02:20 +0000)
committernethack.rankin <nethack.rankin>
Sun, 28 Jan 2007 02:20:40 +0000 (02:20 +0000)
     A fairly recent change had a mistake in it which allowed monsters to
throw, shoot, and zap through walls and closed doors if there was at least
one unobstructed spot between the attacker and the wall or door.

src/mthrowu.c

index f258c998176d5b1a96fbc5f06ca68ff1d8378798..05babac91e785efaf409b6662284500d76d171c4 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mthrowu.c  3.5     2006/12/14      */
+/*     SCCS Id: @(#)mthrowu.c  3.5     2007/01/27      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -736,7 +736,7 @@ int boulderhandling;        /* 0=block, 1=ignore, 2=conditionally block */
                if (IS_ROCK(levl[bx][by].typ) || closed_door(bx, by))
                    return FALSE;
                if (sobj_at(BOULDER, bx, by)) ++boulderspots;
-           } while (bx != ax && by != ay);
+           } while (bx != ax || by != ay);
            /* reached target position without encountering obstacle */
            if (boulderhandling == 1 || rn2(2 + boulderspots) < 2) return TRUE;
        }