Fix some issues found with fuzz testing

Mostly to do with relocating monsters when the level is already full,
and unsticking a monster if it gets relocated.
This commit is contained in:
Pasi Kallinen
2016-12-07 17:53:03 +02:00
parent daff7653f8
commit b8d8556eff
5 changed files with 34 additions and 10 deletions

View File

@@ -380,7 +380,10 @@ register struct monst *mtmp;
if (!rn2(3 + mtmp->mhp / 10))
(void) rloc(mtmp, TRUE);
} else if (sx && (mtmp->mx != sx || mtmp->my != sy)) {
(void) mnearto(mtmp, sx, sy, TRUE);
if (!mnearto(mtmp, sx, sy, TRUE)) {
m_into_limbo(mtmp);
return 0;
}
}
/* if you're not around, cast healing spells */
if (distu(mtmp->mx, mtmp->my) > (BOLT_LIM * BOLT_LIM))
@@ -433,7 +436,8 @@ register struct monst *mtmp;
return 0;
}
} else { /* a monster has it - 'port beside it. */
(void) mnearto(mtmp, tx, ty, FALSE);
if (!mnearto(mtmp, tx, ty, FALSE))
m_into_limbo(mtmp);
return 0;
}
}