From 0814d95040a8c54a9c537dbd667c501136670555 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Sat, 11 Jan 2003 03:46:56 +0000 Subject: [PATCH] B15005 narrow openings and hurtling Narrow openings are currently not checked for by hurtle_step() or mhurtle_step. This has the consequence that you can jump or use Newton's 3rd to get through somewhere you can't get through on the ground, and monsters can stagger or be jousted through somewhere they wouldn't attempt under their own steam. This patch fixes hurtle_step(). It does not address mhurtle_step. --- doc/fixes34.1 | 2 ++ src/dothrow.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 34ae36438..cd7b4b0d5 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -353,6 +353,8 @@ really add artifacts inside carried containers to final score (3.3.1 fix drop alternate weapon to terminate twoweapon combat if the alternate weapon gets cursed restore monster creation sanity checks to wizard mode ^G command +prevent recoil from hurtling you through narrow areas that you wouldn't + be able to move through intentionally Platform- and/or Interface-Specific Fixes diff --git a/src/dothrow.c b/src/dothrow.c index 8eeea3dfb..8520ffb95 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -471,6 +471,17 @@ hurtle_step(arg, x, y) losehp(rnd(2+*range), "touching the edge of the universe", KILLED_BY); return FALSE; } + if ((u.ux - x) && (u.uy - y) && + bad_rock(youmonst.data,u.ux,y) && bad_rock(youmonst.data,x,u.uy)) { + boolean too_much = (invent && (inv_weight() + weight_cap() > 600)); + /* Move at a diagonal. */ + if (bigmonst(youmonst.data) || too_much) { + You("%sget forcefully wedged into a crevice.", + too_much ? "and all your belongings " : ""); + losehp(rnd(2+*range), "wedging into a narrow crevice", KILLED_BY); + return FALSE; + } + } } if ((mon = m_at(x, y)) != 0) { -- 2.40.0