From 17125f250661e8430e320f4c05d74094235f0cf3 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 2 Jan 2009 20:27:50 +0000 Subject: 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 --- crawl-ref/source/stash.cc | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/stash.cc') 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 Stash::get_items() const +{ + return items; +} + +std::vector item_list_in_stash( coord_def pos ) +{ + std::vector 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(sel[0]->data); -- cgit v1.2.3-54-g00ecf