Prevent off-map monsters banking turns

If a monster is marked as off the map, then it is included in
iterations over the monster list, but not allowed to move. This
meant that such monsters would gain movement points on every turn
but not spend them, which could lead to the monster taking a lot of
turns in a row when placed back onto the map.

This commit removes the movement allocation from monsters that are
flagged as dead or removed from the map, meaning that they neve
get more than one turn's worth of movement allocation.
This commit is contained in:
Alex Smith
2026-06-08 04:04:12 +01:00
parent 28cc7cb6bf
commit 9f7a9d2c88
+7 -2
View File
@@ -1236,14 +1236,19 @@ movemon_singlemon(struct monst *mtmp)
(void) gd_move(mtmp);
mtmp->mlstmv = svm.moves;
}
mtmp->movement = 0;
return FALSE;
}
if (DEADMONSTER(mtmp))
if (DEADMONSTER(mtmp)) {
mtmp->movement = 0;
return FALSE;
}
/* monster isn't on this map anymore */
if (mon_offmap(mtmp))
if (mon_offmap(mtmp)) {
mtmp->movement = 0;
return FALSE;
}
m_everyturn_effect(mtmp);