Fix freeing monsters not on map

Sometimes we free the monster data, but the monster is not on the
map - usually this happens if the map is full of monsters and a new one
is migrated on the level.

Make m_detach check the monster x coordinate, so it knows not to touch the map
if the monster isn't on it.
This commit is contained in:
Pasi Kallinen
2018-11-17 19:26:49 +02:00
parent a58571a475
commit 878ac24037
3 changed files with 15 additions and 4 deletions

View File

@@ -464,6 +464,7 @@ fail_mon_placement:
}
(void) mkcorpstat(CORPSE, (struct monst *) 0, mtmp->data, xlocale,
ylocale, CORPSTAT_NONE);
mtmp->mx = mtmp->my = -1; /* for mongone, mon is not anywhere */
mongone(mtmp);
}
}