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:
@@ -430,9 +430,10 @@ boolean with_you;
|
||||
|
||||
mtmp->mx = 0; /*(already is 0)*/
|
||||
mtmp->my = xyflags;
|
||||
if (xlocale)
|
||||
(void) mnearto(mtmp, xlocale, ylocale, FALSE);
|
||||
else {
|
||||
if (xlocale) {
|
||||
if (!mnearto(mtmp, xlocale, ylocale, FALSE))
|
||||
goto fail_mon_placement;
|
||||
} else {
|
||||
if (!rloc(mtmp, TRUE)) {
|
||||
/*
|
||||
* Failed to place migrating monster,
|
||||
@@ -440,6 +441,7 @@ boolean with_you;
|
||||
* Dump the monster's cargo and leave the monster dead.
|
||||
*/
|
||||
struct obj *obj;
|
||||
fail_mon_placement:
|
||||
while ((obj = mtmp->minvent) != 0) {
|
||||
obj_extract_self(obj);
|
||||
obj_no_longer_held(obj);
|
||||
|
||||
Reference in New Issue
Block a user