From cfc594a6e4f1779b6bdc1eb649c5a399ad4a399d Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 27 Jan 2009 10:40:27 +0000 Subject: Fix misleading comment [2540006]. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8812 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/fight.cc') 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); -- cgit v1.2.3-54-g00ecf