diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-24 08:24:46 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-24 08:24:46 +0000 |
commit | 83040a103063abbfa9e92105c47bda428ba8e742 (patch) | |
tree | d0e10c36a84b12ea50418a559ea64392653b32b1 /crawl-ref/source/command.cc | |
parent | ce05e64645f5e9ba07c5b8b72d0da8d5f8cecb28 (diff) | |
download | crawl-ref-83040a103063abbfa9e92105c47bda428ba8e742.tar.gz crawl-ref-83040a103063abbfa9e92105c47bda428ba8e742.zip |
Force update of the quiver by picking up throwable items. This might
hamper performance and is still not optimal: Wielding a sling, running
out of stones, firing darts instead and then picking up some new stones
won't make the quiver switch away from the darts because you "explicitly"
fired them.
Also, can someone please tell me whether "(" or ")" are supposed to loop
to the correct next item? I haven't been able to work that out from the
quiver behaviour alone - it's not all that consistent, unfortunately.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6108 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r-- | crawl-ref/source/command.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 98847ab7ea..6afe25ab5d 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -672,20 +672,24 @@ void list_weapons(void) // Now we print out the current default fire weapon. wstring = "Firing : "; - const item_def* item; - int slot; - you.m_quiver->get_desired_item(&item, &slot); + std::string error_reason; + int slot = you.m_quiver->get_fire_item(&error_reason); colour = MSGCOL_BLACK; - if (slot == -1 && !is_valid_item(*item)) + if (slot == -1) { - wstring += " nothing"; - } - else if (slot == -1) - { - wstring += " - "; - wstring += item->name(DESC_NOCAP_A); - wstring += " (empty)"; + const item_def* item; + you.m_quiver->get_desired_item(&item, &slot); + if (!is_valid_item(*item)) + { + wstring += " nothing"; + } + else + { + wstring += " - "; + wstring += item->name(DESC_NOCAP_A); + wstring += " (empty)"; + } } else { |