summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stash.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-02 20:27:50 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-02 20:27:50 +0000
commit17125f250661e8430e320f4c05d74094235f0cf3 (patch)
tree9f681260f2fed49c56911637fd13a800a5e993e0 /crawl-ref/source/stash.cc
parent5a1d2984131beed046555602cee60045ac665212 (diff)
downloadcrawl-ref-17125f250661e8430e320f4c05d74094235f0cf3.tar.gz
crawl-ref-17125f250661e8430e320f4c05d74094235f0cf3.zip
Fixed 2481704: Travel stopping for spellcasting monsters without LOS
spells behind glass. Fixed 2174517: V giving information about unknown items in stashes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8128 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stash.cc')
-rw-r--r--crawl-ref/source/stash.cc30
1 files changed, 25 insertions, 5 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index 039286565f..c10737d345 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -125,6 +125,26 @@ void describe_stash(int x, int y)
}
}
+
+std::vector<item_def> Stash::get_items() const
+{
+ return items;
+}
+
+std::vector<item_def> item_list_in_stash( coord_def pos )
+{
+ std::vector<item_def> ret;
+
+ LevelStashes *ls = StashTrack.find_current_level();
+ if (ls)
+ {
+ Stash *s = ls->find_stash(pos.x, pos.y);
+ ret = s->get_items();
+ }
+
+ return ret;
+}
+
static void _fully_identify_item(item_def *item)
{
if (!item || !is_valid_item(*item))
@@ -372,7 +392,8 @@ void Stash::update()
// If this is unverified, forget last item on stack. This isn't
// terribly clever, but it prevents the vector swelling forever.
- if (!verified) items.pop_back();
+ if (!verified)
+ items.pop_back();
// Items are different. We'll put this item in the front of our
// vector, and mark this as unverified
@@ -1450,7 +1471,7 @@ void StashTracker::update_visible_stashes(
StashTracker::stash_update_mode mode)
{
if (is_level_untrackable())
- return ;
+ return;
LevelStashes *lev = find_current_level();
for (int cy = crawl_view.glos1.y; cy <= crawl_view.glos2.y; ++cy)
@@ -1823,11 +1844,10 @@ bool StashTracker::display_search_results(
sel = stashmenu.show();
if (stashmenu.request_toggle_sort_method)
- {
return (true);
- }
- if (sel.size() == 1 && stashmenu.menu_action == StashSearchMenu::ACT_EXAMINE)
+ if (sel.size() == 1
+ && stashmenu.menu_action == StashSearchMenu::ACT_EXAMINE)
{
stash_search_result *res =
static_cast<stash_search_result *>(sel[0]->data);