]> granicus.if.org Git - nethack/commitdiff
B15005 narrow openings and hurtling
authornethack.allison <nethack.allison>
Sat, 11 Jan 2003 03:46:56 +0000 (03:46 +0000)
committernethack.allison <nethack.allison>
Sat, 11 Jan 2003 03:46:56 +0000 (03:46 +0000)
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
src/dothrow.c

index 34ae36438ed9f587a823b6ce9e8fad5833c975bb..cd7b4b0d56eb2f8c658436d02c3ec046c3e137b2 100644 (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
index 8eeea3dfb6c705c4aae18c84a99da4f524bf6890..8520ffb95f24b75bb33bfe01e441b0636e0cf153 100644 (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) {