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:
2
src/do.c
2
src/do.c
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user