From 8eb206765d8d53a51245f6346d5088756de27201 Mon Sep 17 00:00:00 2001 From: cohrs Date: Fri, 1 Feb 2002 03:30:40 +0000 Subject: [PATCH] grappling hook ignores spot effects Using a grappling hook can land you in water, lava, et al, but you were unaffected. --- doc/fixes33.2 | 1 + src/apply.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/fixes33.2 b/doc/fixes33.2 index 3693db6c3..d9f4451fc 100644 --- a/doc/fixes33.2 +++ b/doc/fixes33.2 @@ -411,6 +411,7 @@ secret corridor detected out of vision range is still displayed (prevents bug getobj can now see user-specified count when using inventory to make selection scalpel is stainless steel (i.e. METAL) not regular steel (IRON) eggs, potions & other breakables may break when they fall down stairs +hurtling via grappling hook does not apply effects of destination location Platform- and/or Interface-Specific Fixes diff --git a/src/apply.c b/src/apply.c index b2c86f6e2..aa2cc6a5b 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2332,8 +2332,7 @@ use_grapple (obj) } /* What did you hit? */ - switch (rn2(5)) - { + switch (rn2(5)) { case 0: /* Trap */ /* FIXME -- untrap needs to deal with non-adjacent traps */ break; @@ -2361,9 +2360,13 @@ use_grapple (obj) } /* FALL THROUGH */ case 3: /* Surface */ - You("are yanked toward the %s!", - surface(cc.x, cc.y)); - hurtle(sgn(cc.x-u.ux), sgn(cc.y-u.uy), 1, FALSE); + if (IS_AIR(levl[cc.x][cc.y].typ) || is_pool(cc.x, cc.y)) + pline_The("hook slices through the %s.", surface(cc.x, cc.y)); + else { + You("are yanked toward the %s!", surface(cc.x, cc.y)); + hurtle(sgn(cc.x-u.ux), sgn(cc.y-u.uy), 1, FALSE); + spoteffects(); + } return (1); default: /* Yourself (oops!) */ if (P_SKILL(typ) <= P_BASIC) {