Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-06-02 16:19:53 -04:00
4 changed files with 28 additions and 10 deletions

View File

@@ -42,6 +42,8 @@ some improvement to the handling of endgame levels filling up with monsters
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
------------------------------------------------------------------ ------------------------------------------------------------------
elemental_clog() loop needed to guard against obliteration of the monster
that was trying to be placed
curses: sometimes the message window would show a blank line after a prompt curses: sometimes the message window would show a blank line after a prompt

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dungeon.c $NHDT-Date: 1558853012 2019/05/26 06:43:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.94 $ */ /* NetHack 3.6 dungeon.c $NHDT-Date: 1559476918 2019/06/02 12:01:58 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.95 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1185,6 +1185,13 @@ void
u_on_newpos(x, y) u_on_newpos(x, y)
int x, y; int x, y;
{ {
if (!isok(x, y)) { /* validate location */
void VDECL((*func), (const char *, ...)) PRINTF_F(1, 2);
func = (x < 0 || y < 0 || x > COLNO - 1 || y > ROWNO - 1) ? panic
: impossible;
(*func)("u_on_newpos: trying to place hero off map <%d,%d>", x, y);
}
u.ux = x; u.ux = x;
u.uy = y; u.uy = y;
#ifdef CLIPPING #ifdef CLIPPING

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mkobj.c $NHDT-Date: 1558124913 2019/05/17 20:28:33 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.147 $ */ /* NetHack 3.6 mkobj.c $NHDT-Date: 1559476922 2019/06/02 12:02:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.149 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */ /*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1723,8 +1723,17 @@ int x, y;
{ {
register struct obj *otmp2 = g.level.objects[x][y]; register struct obj *otmp2 = g.level.objects[x][y];
if (!isok(x, y)) { /* validate location */
void VDECL((*func), (const char *, ...)) PRINTF_F(1, 2);
func = (x < 0 || y < 0 || x > COLNO - 1 || y > ROWNO - 1) ? panic
: impossible;
(*func)("place_object: \"%s\" [%d] off map <%d,%d>",
safe_typename(otmp->otyp), otmp->where, x, y);
}
if (otmp->where != OBJ_FREE) if (otmp->where != OBJ_FREE)
panic("place_object: obj not free"); panic("place_object: obj \"%s\" [%d] not free",
safe_typename(otmp->otyp), otmp->where);
obj_no_longer_held(otmp); obj_no_longer_held(otmp);
if (otmp->otyp == BOULDER) { if (otmp->otyp == BOULDER) {

View File

@@ -1845,10 +1845,9 @@ struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */
shkgone(mtmp); shkgone(mtmp);
if (mtmp->wormno) if (mtmp->wormno)
wormgone(mtmp); wormgone(mtmp);
if (In_endgame(&u.uz)) { if (In_endgame(&u.uz))
mtmp->mx = mtmp->my = 0;
mtmp->mstate |= MON_ENDGAME_FREE; mtmp->mstate |= MON_ENDGAME_FREE;
}
mtmp->mstate |= MON_DETACH; mtmp->mstate |= MON_DETACH;
iflags.purge_monsters++; iflags.purge_monsters++;
} }
@@ -2633,7 +2632,7 @@ struct monst *mon;
m1 = m2 = m3 = m4 = m5 = zm = (struct monst *) 0; m1 = m2 = m3 = m4 = m5 = zm = (struct monst *) 0;
if (!msgmv || (g.moves - msgmv) > 200L) { if (!msgmv || (g.moves - msgmv) > 200L) {
if (!msgmv || rn2(2)) if (!msgmv || rn2(2))
You("feel besieged."); You_feel("besieged.");
msgmv = g.moves; msgmv = g.moves;
} }
/* /*
@@ -2644,7 +2643,7 @@ struct monst *mon;
* m5 a pet. * m5 a pet.
*/ */
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (DEADMONSTER(mtmp)) if (DEADMONSTER(mtmp) || mtmp == mon)
continue; continue;
if (mtmp->mx == 0 && mtmp->my == 0) if (mtmp->mx == 0 && mtmp->my == 0)
continue; continue;
@@ -2679,8 +2678,9 @@ struct monst *mon;
mtmp->mstate |= MON_OBLITERATE; mtmp->mstate |= MON_OBLITERATE;
mongone(mtmp); mongone(mtmp);
mtmp->mx = mtmp->my = 0; /* some places in the code might still reference mtmp->mx, mtmp->my */
rloc_to(mon, mx, my); /* mtmp->mx = mtmp->my = 0; */
rloc_to(mon, mx, my); /* note: mon, not mtmp */
} else { } else {
/* last resort - migrate mon to the next plane */ /* last resort - migrate mon to the next plane */
if (Is_waterlevel(&u.uz) || Is_firelevel(&u.uz) || Is_earthlevel(&u.uz)) { if (Is_waterlevel(&u.uz) || Is_firelevel(&u.uz) || Is_earthlevel(&u.uz)) {