summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index afe2e6f91d..7d3c3d8fb3 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -3582,11 +3582,19 @@ static void handle_monster_move(int i, monsters *monster)
return;
}
- monster->speed_increment += (monster->speed * you.time_taken) / 10;
+ int energy_gained = (monster->speed * you.time_taken) / 10;
+
+ // Slow monsters might get 0 here. Maybe we should factor in
+ // *how* slow it is...but a 10-to-1 move ratio seems more than
+ // enough.
+ if ( energy_gained == 0 && monster->speed != 0 )
+ energy_gained = 1;
+
+ monster->speed_increment += energy_gained;
if (you.slow > 0)
{
- monster->speed_increment += (monster->speed * you.time_taken) / 10;
+ monster->speed_increment += energy_gained;
}
// Handle enchantments and clouds on nonmoving monsters: