From: cohrs Date: Thu, 25 Sep 2003 22:44:27 +0000 (+0000) Subject: U673 - hooks and grappling hook working thru walls X-Git-Tag: MOVE2GIT~1756 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96b56a7bd78a334c0640dfd5a009661faaf23aaa;p=nethack U673 - hooks and grappling hook working thru walls 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(). --- diff --git a/doc/fixes34.3 b/doc/fixes34.3 index 0abb94c30..cfa67376e 100644 --- a/doc/fixes34.3 +++ b/doc/fixes34.3 @@ -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 diff --git a/src/apply.c b/src/apply.c index dcdee0828..25ec4a60f 100644 --- a/src/apply.c +++ b/src/apply.c @@ -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? */