Moving long worms may still put tail in old location

When using rloc and friends to move monsters, and the monster
happens to be a long worm, the tail may get randomly placed
in the same place where the long worm was removed from.

In the cases where we expect the location to really be free,
explicitly recheck the location for a monster after rloc.
This commit is contained in:
Pasi Kallinen
2018-11-19 21:24:08 +02:00
parent 657f557821
commit 9ad7268c0a
2 changed files with 2 additions and 2 deletions

View File

@@ -1446,7 +1446,7 @@ boolean at_stairs, falling, portal;
with the situation, so only say something when debugging */
if (wizard)
pline("(monster in hero's way)");
if (!rloc(mtmp, TRUE))
if (!rloc(mtmp, TRUE) || m_at(u.ux, u.uy))
/* no room to move it; send it away, to return later */
migrate_to_level(mtmp, ledger_no(&u.uz), MIGR_RANDOM,
(coord *) 0);

View File

@@ -586,7 +586,7 @@ int nx,ny;
if (MON_AT(nx, ny) && nx != grd->mx && ny != grd->my) {
if (!Deaf)
verbalize("Out of my way, scum!");
if (!rloc(m_at(nx, ny), FALSE))
if (!rloc(m_at(nx, ny), FALSE) || m_at(nx, ny))
m_into_limbo(m_at(nx, ny));
}
}