diff options
author | elliptic <hyperelliptical@gmail.com> | 2014-05-14 03:53:31 -0400 |
---|---|---|
committer | elliptic <hyperelliptical@gmail.com> | 2014-05-14 04:03:26 -0400 |
commit | 8b15fbdb43eb0ee52b97be2f14c054238e45735a (patch) | |
tree | 0701609b00eca91defdece47a94ab3a65dc97ed7 /crawl-ref/source/monster.h | |
parent | 5152fba6f8daa055ed72bbd62dd5389cc7acacbe (diff) | |
download | crawl-ref-8b15fbdb43eb0ee52b97be2f14c054238e45735a.tar.gz crawl-ref-8b15fbdb43eb0ee52b97be2f14c054238e45735a.zip |
Fix rounding errors with drained skills.
Previously you could have a drained skill display as 10.5 on the m screen but
have you.skill(SK_blah) return 9 for it because of inconsistent rounding.
This fixes that issue, though I wonder if it might be simpler to just use a
fixed large scale during all the skill calculations and then convert to the
requested scale at the end.
Diffstat (limited to 'crawl-ref/source/monster.h')
-rw-r--r-- | crawl-ref/source/monster.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h index 1e4525eec8..a3ae827b0f 100644 --- a/crawl-ref/source/monster.h +++ b/crawl-ref/source/monster.h @@ -300,7 +300,8 @@ public: bool fumbles_attack(bool verbose = true); bool cannot_fight() const; - int skill(skill_type skill, int scale = 1, bool real = false) const; + int skill(skill_type skill, int scale = 1, + bool real = false, bool drained = true) const; void attacking(actor *other, bool ranged); bool can_go_frenzy() const; |