From 9f7a9d2c88aacb080d95e7f8c24b36802b09e7a9 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Mon, 8 Jun 2026 04:04:12 +0100 Subject: [PATCH] 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. --- src/mon.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mon.c b/src/mon.c index c67785325..cc70c0453 100644 --- a/src/mon.c +++ b/src/mon.c @@ -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);