mnearto/mnexto/enexto
This doesn't solve the <0,0> problem but it does prevent mnexto() from using uninitialized coordinates if enexto() fails. It also adds several debugging messages. enexto() was ignoring map row #0 (unlike column #0, row #0 contains valid map locations). Fixing that doesn't matter for Plane of Water though since that row is stone there--that's probably a bug. It was also repeatedly re-testing the top+1 and bottom rows and left and right columns after they had already failed to be acceptable. It still does some of that, but less.
This commit is contained in:
10
src/mkmaze.c
10
src/mkmaze.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mkmaze.c $NHDT-Date: 1559088524 2019/05/29 00:08:44 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.71 $ */
|
||||
/* NetHack 3.6 mkmaze.c $NHDT-Date: 1559227829 2019/05/30 14:50:29 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.72 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Pasi Kallinen, 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1858,6 +1858,7 @@ boolean ini;
|
||||
for (olist = (struct obj *) cons->list; olist; olist = otmp) {
|
||||
otmp = olist->nexthere;
|
||||
place_object(olist, cons->x, cons->y);
|
||||
stackobj(olist);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1865,7 +1866,12 @@ boolean ini;
|
||||
case CONS_MON: {
|
||||
struct monst *mon = (struct monst *) cons->list;
|
||||
|
||||
(void) mnearto(mon, cons->x, cons->y, TRUE);
|
||||
/* mnearto() might fail, and putting the monster into limbo
|
||||
to try next time hero comes to this level makes no sense
|
||||
because we can't leave and return (outside wizard mode) */
|
||||
if (!mnearto(mon, cons->x, cons->y, TRUE)) {
|
||||
; /* ? */
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user