level arrival

The check I added to make sure that a monster was at the hero's
coordinates before deciding to move one or the other would have been
confused by a long worm's tail.  Check that they're at that spot but
not by comparing monst.<mx,my> coordinates with <ux,uy>.

Also, don't have wiz_makemap() assume that each level of the Wizard's
Tower has the same boundary coordinates.  Keep track of whether hero
is inside that tower before discarding the old level.
This commit is contained in:
PatR
2019-01-14 16:35:19 -08:00
parent 992f141ab7
commit 97b28bd846
2 changed files with 15 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1547486885 2019/01/14 17:28:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.327 $ */
/* NetHack 3.6 cmd.c $NHDT-Date: 1547512504 2019/01/15 00:35:04 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.328 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -800,6 +800,7 @@ wiz_makemap(VOID_ARGS)
{
if (wizard) {
struct monst *mtmp;
boolean was_in_W_tower = In_W_tower(u.ux, u.uy, &u.uz);
rm_mapseen(ledger_no(&u.uz));
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
@@ -855,12 +856,12 @@ wiz_makemap(VOID_ARGS)
/* was using safe_teleds() but that doesn't honor arrival region
on levels which have such; we don't force stairs, just area */
u_on_rndspot((u.uhave.amulet ? 1 : 0) /* 'going up' flag */
| (In_W_tower(u.ux, u.uy, &u.uz) ? 2 : 0));
| (was_in_W_tower ? 2 : 0));
losedogs();
/* u_on_rndspot() might pick a spot that has a monster, or losedogs()
might pick the hero's spot (only if there isn't already a monster
there), so we might have to move hero or the co-located monster */
if ((mtmp = m_at(u.ux, u.uy)) != 0 && mtmp != u.usteed)
if ((mtmp = m_at(u.ux, u.uy)) != 0)
u_collide_m(mtmp);
initrack();
if (Punished) {