kicking off edge of map
From a bug report: if you
were at one of the map edges and kicked away from map center while blind,
you'd get impossible("show_glyph: bad pos ..."). That was due to calling
feel_location() for the out of bounds location, which occurred after the
kick code had made use of invalid data so other problems might occur too.
Now you kick "nothing" as if it was something (hence possibly wounding
your leg, taking some damage, potentially dying). I didn't want to try to
classify the surrounding terrain as rock or air or whatever, and the thing
being kicked only shows up if the kick is fatal.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* 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. */
|
||||
@@ -502,16 +502,18 @@ void
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user