shopkeepers and priests wouldn't step on graves put in their rooms by bones
can't throw if poly'd into form which lacks hands
can't eat an artifact you're unable to touch
+attempting to kick beyond map edge performed an out of array bounds memory
+ access; symptom seen was "show_glyph: bad pos" warning when blind
Platform- and/or Interface-Specific Fixes
-/* SCCS Id: @(#)display.c 3.5 2007/01/17 */
+/* SCCS Id: @(#)display.c 3.5 2007/01/26 */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
feel_location(x, y)
xchar x, y;
{
- struct rm *lev = &(levl[x][y]);
+ struct rm *lev;
struct obj *boulder;
register struct monst *mon;
+ if (!isok(x, y)) return;
+ lev = &(levl[x][y]);
/* If the hero's memory of an invisible monster is accurate, we want to keep
* him from detecting the same monster over and over again on each turn.
* We must return (so we don't erase the monster). (We must also, in the
* search function, be sure to skip over previously detected 'I's.)
*/
- if (glyph_is_invisible(levl[x][y].glyph) && m_at(x,y)) return;
+ if (glyph_is_invisible(lev->glyph) && m_at(x,y)) return;
/* The hero can't feel non pool locations while under water. */
if (Underwater && !Is_waterlevel(&u.uz) && ! is_pool(x,y))
-/* SCCS Id: @(#)dokick.c 3.5 2007/01/02 */
+/* SCCS Id: @(#)dokick.c 3.5 2007/01/26 */
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
#define martial() (martial_bonus() || is_bigfoot(youmonst.data) || \
(uarmf && uarmf->otyp == KICKING_BOOTS))
-static NEARDATA struct rm *maploc;
+static NEARDATA struct rm *maploc, nowhere;
static NEARDATA const char *gate_str;
extern boolean notonhead; /* for long worms */
const char *what;
if (kickobj) what = killer_xname(kickobj);
+ if (maploc == &nowhere) what = "nothing";
else if (IS_DOOR(maploc->typ)) what = "a door";
else if (IS_TREE(maploc->typ)) what = "a tree";
else if (IS_STWALL(maploc->typ)) what = "a wall";
wake_nearby();
u_wipe_engr(2);
+ if (!isok(x, y)) {
+ maploc = &nowhere;
+ goto ouch;
+ }
maploc = &levl[x][y];
/* The next five tests should stay in */
pline("Ouch! That hurts!");
exercise(A_DEX, FALSE);
exercise(A_STR, FALSE);
- if (Blind) feel_location(x,y); /* we know we hit it */
- if (is_drawbridge_wall(x,y) >= 0) {
- pline_The("drawbridge is unaffected.");
- /* update maploc to refer to the drawbridge */
- (void) find_drawbridge(&x,&y);
- maploc = &levl[x][y];
+ if (isok(x, y)) {
+ if (Blind) feel_location(x,y); /* we know we hit it */
+ if (is_drawbridge_wall(x,y) >= 0) {
+ pline_The("drawbridge is unaffected.");
+ /* update maploc to refer to the drawbridge */
+ (void) find_drawbridge(&x,&y);
+ maploc = &levl[x][y];
+ }
}
if(!rn2(3)) set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
dmg = rnd(ACURR(A_CON) > 15 ? 3 : 5);