diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-13 11:16:17 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-13 11:16:17 +0000 |
commit | 3800d44b7952e7ae1f05b711ad46268dde11821d (patch) | |
tree | 0f3726a7ecc2ce8690b55ea91ad9cf3ac1f99d65 /crawl-ref/source/spl-cast.cc | |
parent | dc024449143f2b6d6599bc41dabfbb3109a76999 (diff) | |
download | crawl-ref-3800d44b7952e7ae1f05b711ad46268dde11821d.tar.gz crawl-ref-3800d44b7952e7ae1f05b711ad46268dde11821d.zip |
Fix 2162827: tag length calculation was incorrect.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7230 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 826d84bd91..5abc08b98b 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -168,41 +168,6 @@ static std::string _spell_base_description(spell_type spell) return desc.str(); } -static int _string_tag_length(const std::string& s) -{ - int taglen = 0; - bool in_tag = false; - int last_taglen = 0; - for (std::string::const_iterator ci = s.begin(); ci != s.end(); ++ci) - { - if (in_tag) - { - if (*ci == '<' && last_taglen == 1) - { - in_tag = false; - --taglen; - } - else if (*ci == '>') - { - in_tag = false; - ++taglen; - } - else - { - ++last_taglen; - ++taglen; - } - } - else if (*ci == '<') - { - in_tag = true; - last_taglen = 1; - ++taglen; - } - } - return (taglen); -} - static std::string _spell_extra_description(spell_type spell) { std::ostringstream desc; @@ -216,7 +181,7 @@ static std::string _spell_extra_description(spell_type spell) const std::string rangestring = spell_range_string(spell); desc << std::setw(14) << spell_power_string(spell) - << std::setw(16 + _string_tag_length(rangestring)) << rangestring + << std::setw(16 + tagged_string_tag_length(rangestring)) << rangestring << std::setw(12) << spell_hunger_string(spell) << spell_difficulty(spell); |