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.
This commit is contained in:
nethack.allison
2003-01-11 03:46:56 +00:00
parent 3db1e1c4a4
commit 0814d95040
2 changed files with 13 additions and 0 deletions

View File

@@ -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

View File

@@ -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) {