]> granicus.if.org Git - nethack/commitdiff
U673 - hooks and grappling hook working thru walls
authorcohrs <cohrs>
Thu, 25 Sep 2003 22:44:27 +0000 (22:44 +0000)
committercohrs <cohrs>
Thu, 25 Sep 2003 22:44:27 +0000 (22:44 +0000)
While wearing the Eyes of the Overworld, one could use a hook or pole thru
walls.  The bug report thought they should work past a boulder, but I
disagree, given a pole or hook's rigid nature, and did not special case that.
couldsee() is not affected by the Eyes, so use that after checking cansee().

doc/fixes34.3
src/apply.c

index 0abb94c30c70eb97440b4be13181173d88b86dc3..cfa67376e95d3e9c85f299e0b0165c8c7c143702 100644 (file)
@@ -28,6 +28,7 @@ it was inappropriate to have a ghost "appear" in desecrated temple when
 accept wish for "grey spell book" not just "grey spellbook"
 do not double credit when putting gold into an unpaid container
 manes are nonliving
+poles and grappling hook worked thru walls when wearing Eyes of the Overworld
 
 
 Platform- and/or Interface-Specific Fixes
index dcdee08288d9788505e43748807472ea88df5f36..25ec4a60f1fecc6d5d082208a6c083ac1addb0ee 100644 (file)
@@ -2358,7 +2358,8 @@ struct obj *obj;
 static const char
        not_enough_room[] = "There's not enough room here to use that.",
        where_to_hit[] = "Where do you want to hit?",
-       cant_see_spot[] = "won't hit anything if you can't see that spot.";
+       cant_see_spot[] = "won't hit anything if you can't see that spot.",
+       cant_reach[] = "can't reach that spot from here.";
 
 /* Distance attacks by pole-weapons */
 STATIC_OVL int
@@ -2404,6 +2405,9 @@ use_pole (obj)
                    !canseemon(mtmp))) {
            You(cant_see_spot);
            return (res);
+       } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
+           You(cant_reach);
+           return res;
        }
 
        /* Attack the monster there */
@@ -2502,6 +2506,9 @@ use_grapple (obj)
        } else if (!cansee(cc.x, cc.y)) {
            You(cant_see_spot);
            return (res);
+       } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
+           You(cant_reach);
+           return res;
        }
 
        /* What do you want to hit? */