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().
This commit is contained in:
cohrs
2003-09-25 22:44:27 +00:00
parent 4375fc7846
commit 96b56a7bd7
2 changed files with 9 additions and 1 deletions

View 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? */