summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/monstuff.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 17253a1ca0..66fafc2233 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -6966,6 +6966,8 @@ static void _handle_monster_move(monsters *monster)
if (!monster->alive())
break;
+ const coord_def old_pos = monster->pos();
+
#if DEBUG_MONS_SCAN
if (!monster_was_floating
&& mgrd(monster->pos()) != monster->mindex())
@@ -7327,6 +7329,10 @@ static void _handle_monster_move(monsters *monster)
if (mons_cannot_move(monster) || !_monster_move(monster))
monster->speed_increment -= non_move_energy;
+ else if (monster->pos() == old_pos)
+ // There was nowhere the monster could move to, so it did
+ // nothing.
+ monster->speed_increment -= non_move_energy;
}
update_beholders(monster);
@@ -7338,7 +7344,6 @@ static void _handle_monster_move(monsters *monster)
_handle_behaviour(monster);
ASSERT(in_bounds(monster->target) || monster->target.origin());
}
-
}
if (monster->type != -1 && monster->hit_points < 1)