avoid impossible() with inbound migrating mon
This commit is contained in:
@@ -64,6 +64,7 @@ enum m_ap_types {
|
||||
#define MON_ENDGAME_FREE 0x20
|
||||
#define MON_ENDGAME_MIGR 0x40
|
||||
#define MON_OBLITERATE 0x80
|
||||
#define MON_STILL_ARRIVING 0x100
|
||||
|
||||
#define M_AP_TYPMASK 0x7
|
||||
#define M_AP_F_DKNOWN 0x8
|
||||
|
||||
@@ -1505,6 +1505,8 @@ see_monsters(void)
|
||||
for (mon = fmon; mon; mon = mon->nmon) {
|
||||
if (DEADMONSTER(mon))
|
||||
continue;
|
||||
if ((mon->mstate & MON_STILL_ARRIVING) != 0)
|
||||
continue;
|
||||
newsym(mon->mx, mon->my);
|
||||
if (mon->wormno)
|
||||
see_wsegs(mon);
|
||||
|
||||
@@ -427,6 +427,7 @@ mon_arrive(struct monst *mtmp, int when)
|
||||
stairway *stway;
|
||||
d_level fromdlev;
|
||||
|
||||
mtmp->mstate |= MON_STILL_ARRIVING;
|
||||
mtmp->nmon = fmon;
|
||||
fmon = mtmp;
|
||||
if (mtmp->isshk)
|
||||
@@ -475,6 +476,7 @@ mon_arrive(struct monst *mtmp, int when)
|
||||
rloc_to(mtmp, u.ux, u.uy);
|
||||
else
|
||||
mnexto(mtmp, RLOC_NOMSG);
|
||||
mtmp->mstate &= ~MON_STILL_ARRIVING;
|
||||
return;
|
||||
} else if (when == Wiz_arrive) {
|
||||
/* resurrect() is bringing existing wizard to harass the hero */
|
||||
@@ -604,6 +606,8 @@ mon_arrive(struct monst *mtmp, int when)
|
||||
|
||||
mtmp->mx = 0; /*(already is 0)*/
|
||||
mtmp->my = xyflags;
|
||||
mtmp->mstate &= ~MON_STILL_ARRIVING;
|
||||
|
||||
if (xlocale)
|
||||
failed_to_place = !mnearto(mtmp, xlocale, ylocale, FALSE, RLOC_NOMSG);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user