fix #H8481 - placing monster at <0,0>

mon_arrive() -> m_into_limbo() -> migrate_to_level() -> wormgone()
followed by place_monster() "for relmon".  relmon() was changed (last
November, cc5bb44a9a) to not require
the monster be on the map, so just get rid of the place_monster() that
was trying to put the "gone" long worm at <0,0>.

Also, another m_into_limbo() bit:  make mdrop_special_objs() check the
location and send any dropped items to random locations if the monster
dropping things isn't on the map, instead of placing them at <0,0>.
This commit is contained in:
PatR
2019-04-06 12:57:29 -07:00
parent 0bfd12dd16
commit f52e9865f2
4 changed files with 22 additions and 13 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.298 $ $NHDT-Date: 1554425733 2019/04/05 00:55:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.299 $ $NHDT-Date: 1554580624 2019/04/06 19:57:04 $
This fixes36.2 file is here to capture information about updates in the 3.6.x This fixes36.2 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.1 in April 2018. Please note, however, lineage following the release of 3.6.1 in April 2018. Please note, however,
@@ -406,6 +406,9 @@ shorten the getpos prompt for teleport destination so that it won't yield a
once a status highlight for a temporary rule ('up', 'down', 'changed') timed once a status highlight for a temporary rule ('up', 'down', 'changed') timed
out, further spurious status updates (evaluating all fields) would out, further spurious status updates (evaluating all fields) would
occur every 'statushilites' turns even if no fields had changed occur every 'statushilites' turns even if no fields had changed
if a migrating long worm couldn't be placed, or some other monster was given
an existing long worm's place and it couldn't be put somewhere else,
a "trying to place monster at <0,0>" warning would occur
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
+3 -7
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dog.c $NHDT-Date: 1543052701 2018/11/24 09:45:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.84 $ */ /* NetHack 3.6 dog.c $NHDT-Date: 1554580624 2019/04/06 19:57:04 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.85 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -7,11 +7,6 @@
STATIC_DCL int NDECL(pet_type); STATIC_DCL int NDECL(pet_type);
/* cloned from mon.c; used here if mon_arrive() can't place mon */
#define LEVEL_SPECIFIC_NOCORPSE(mdat) \
(Is_rogue_level(&u.uz) \
|| (level.flags.graveyard && is_undead(mdat) && rn2(3)))
void void
newedog(mtmp) newedog(mtmp)
struct monst *mtmp; struct monst *mtmp;
@@ -697,7 +692,8 @@ coord *cc; /* optional destination coordinates */
/* **** NOTE: worm is truncated to # segs = max wormno size **** */ /* **** NOTE: worm is truncated to # segs = max wormno size **** */
num_segs = min(cnt, MAX_NUM_WORMS - 1); /* used below */ num_segs = min(cnt, MAX_NUM_WORMS - 1); /* used below */
wormgone(mtmp); /* destroys tail and takes head off map */ wormgone(mtmp); /* destroys tail and takes head off map */
place_monster(mtmp, mtmp->mx, mtmp->my); /* put head back for relmon */ /* there used to be a place_monster() here for the relmon() below,
but it doesn't require the monster to be on the map anymore */
} }
/* set minvent's obj->no_charge to 0 */ /* set minvent's obj->no_charge to 0 */
+3 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mon.c $NHDT-Date: 1550524562 2019/02/18 21:16:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.279 $ */ /* NetHack 3.6 mon.c $NHDT-Date: 1554580625 2019/04/06 19:57:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.280 $ */
/* 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. */
@@ -2649,7 +2649,7 @@ boolean move_other; /* make sure mtmp gets to x, y! so move m_at(x, y) */
xchar newx, newy; xchar newx, newy;
coord mm; coord mm;
if (mtmp->mx == x && mtmp->my == y && m_at(x,y) == mtmp) if (mtmp->mx == x && mtmp->my == y && m_at(x, y) == mtmp)
return TRUE; return TRUE;
if (move_other && (othermon = m_at(x, y)) != 0) { if (move_other && (othermon = m_at(x, y)) != 0) {
@@ -2668,7 +2668,7 @@ boolean move_other; /* make sure mtmp gets to x, y! so move m_at(x, y) */
*/ */
if (!enexto(&mm, newx, newy, mtmp->data)) if (!enexto(&mm, newx, newy, mtmp->data))
return FALSE; return FALSE;
if (!isok(mm.x,mm.y)) if (!isok(mm.x, mm.y))
return FALSE; return FALSE;
newx = mm.x; newx = mm.x;
newy = mm.y; newy = mm.y;
+12 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 steal.c $NHDT-Date: 1496614914 2017/06/04 22:21:54 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.69 $ */ /* NetHack 3.6 steal.c $NHDT-Date: 1554580626 2019/04/06 19:57:06 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.72 $ */
/* 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. */
@@ -693,7 +693,17 @@ struct monst *mon;
for the other roles are not */ for the other roles are not */
if (obj_resists(obj, 0, 0) || is_quest_artifact(obj)) { if (obj_resists(obj, 0, 0) || is_quest_artifact(obj)) {
obj_extract_self(obj); obj_extract_self(obj);
mdrop_obj(mon, obj, FALSE); if (mon->mx) {
mdrop_obj(mon, obj, FALSE);
} else { /* migrating monster not on map */
if (obj->owornmask) {
mon->misc_worn_check &= ~obj->owornmask;
if (obj->owornmask & W_WEP)
setmnotwielded(mon, obj);
obj->owornmask = 0L;
}
rloco(obj);
}
} }
} }
} }