]> granicus.if.org Git - nethack/commitdiff
extremely porous boulders (trunk only)
authornethack.rankin <nethack.rankin>
Tue, 17 Jul 2007 01:07:37 +0000 (01:07 +0000)
committernethack.rankin <nethack.rankin>
Tue, 17 Jul 2007 01:07:37 +0000 (01:07 +0000)
     This is another item from "#Q397: List of Bugs from #nethack" sent
in Janurary by <email deleted> and containing a list
of things collected from the IRC channel associated with nethack.alt.org's
public server.  Using F prefix and moving toward a boulder would give
"You attack thin air."  Now that'll be "You harmlessly attack a boulder."

doc/fixes35.0
src/hack.c

index 235f1e5520d3c60a0b186219bfc4e85697912be2..690e5fddf44e632a335945f5f9d0e8fe8a83d60e 100644 (file)
@@ -258,6 +258,7 @@ can't swap places with tame grid bug when moving diagonally
 can't move diagonally through a long worm's body (can still fight that way)
 require confirmation to read a scroll of mail if doing so will be the first
        violation of illiteracy conduct
+using F to force an attack towards a boulder gave "you attack thin air"
 
 
 Platform- and/or Interface-Specific Fixes
index d95b4c38a5c33a004e16bdd71be9d005abd69a51..252d26372df7a4144d994336860b0e51eb040a9f 100644 (file)
@@ -1203,17 +1203,28 @@ domove()
        if (context.forcefight ||
            /* remembered an 'I' && didn't use a move command */
            (glyph_is_invisible(levl[x][y].glyph) && !context.nopick)) {
+               struct obj *boulder = sobj_at(BOULDER, x, y);
                boolean explo = (Upolyd && attacktype(youmonst.data, AT_EXPL));
-               char buf[BUFSZ];
-               Sprintf(buf,"a vacant spot on the %s", surface(x,y));
-               You("%s %s.",
+               char buf[BUFSZ];
+
+               if (boulder)
+                   Strcpy(buf, ansimpleoname(boulder));
+               else if (!Underwater)
+                   Strcpy(buf, "thin air");
+               else if (is_pool(x, y))
+                   Strcpy(buf, "empty water");
+               else    /* Underwater, targetting non-water */
+                   Sprintf(buf, "a vacant spot on the %s", surface(x,y));
+               You("%s%s %s.",
+                   !boulder ? "" : !explo ? "harmlessly " : "futilely ",
                    explo ? "explode at" : "attack",
-                   !Underwater ? "thin air" :
-                   is_pool(x,y) ? "empty water" : buf);
+                   buf);
                unmap_object(x, y); /* known empty -- remove 'I' if present */
+               if (boulder) map_object(boulder, TRUE);
                newsym(x, y);
                nomul(0);
                if (explo) {
+                   wake_nearby();
                    u.mh = -1;          /* dead in the current form */
                    rehumanize();
                }