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/item_use.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/item_use.cc')
-rw-r--r-- | crawl-ref/source/item_use.cc | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 3d6c9c6f24..bf47e513ff 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1294,10 +1294,6 @@ void fire_target_behaviour::message_ammo_prompt(const std::string* pre_text) const int next_item = get_next_fire_item(m_slot, +1); bool no_other_items = (next_item == -1 || next_item == m_slot); - // How many letters are only needed for formatting, but won't ever - // be printed. - int colour_length = 0; - mesclr(); if (pre_text) @@ -1329,7 +1325,6 @@ void fire_target_behaviour::message_ammo_prompt(const std::string* pre_text) if (m_slot == -1) { msg << "<red>" << m_noitem_reason << "</red>"; - colour_length = 5; } else { @@ -1337,11 +1332,10 @@ void fire_target_behaviour::message_ammo_prompt(const std::string* pre_text) msg << "<" << colour << ">" << you.inv[m_slot].name(DESC_INVENTORY_EQUIP) << "</" << colour << ">"; - colour_length = (selected_from_inventory ? 11 : 3); } - formatted_message_history(msg.str() - .substr(0, crawl_view.msgsz.x + colour_length), + formatted_message_history(tagged_string_substr(msg.str(), + 0, crawl_view.msgsz.x), MSGCH_PROMPT); } |