summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-27 10:40:27 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-27 10:40:27 +0000
commitcfc594a6e4f1779b6bdc1eb649c5a399ad4a399d (patch)
treefe76c20022dd27c125ca5b62a13fc4fc7e67a48c /crawl-ref/source/fight.cc
parenta124171efd9ff0f38532b3a15a008705ad58ae38 (diff)
downloadcrawl-ref-cfc594a6e4f1779b6bdc1eb649c5a399ad4a399d.tar.gz
crawl-ref-cfc594a6e4f1779b6bdc1eb649c5a399ad4a399d.zip
Fix misleading comment [2540006].
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8812 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 422af83ad8..e00f2c89e4 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3660,20 +3660,17 @@ int melee_attack::player_unarmed_speed()
{
int unarmed_delay = 10;
+ // Not even bats can attack faster than this.
min_delay = 5;
// Unarmed speed.
if (you.burden_state == BS_UNENCUMBERED
&& one_chance_in(heavy_armour_penalty + 1))
{
- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
- unarmed_delay = 10 - you.skills[SK_UNARMED_COMBAT] / 3;
- else
- unarmed_delay = 10 - you.skills[SK_UNARMED_COMBAT] / 5;
-
- // This shouldn't happen anyway... sanity.
- if (unarmed_delay < min_delay)
- unarmed_delay = min_delay;
+ const bool is_bat = (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT);
+ unarmed_delay =
+ std::max(10 - you.skills[SK_UNARMED_COMBAT] / (is_bat ? 3 : 5),
+ min_delay);
}
return (unarmed_delay);