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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user