From f69ba51dd364f66462af1a099193de467312407f Mon Sep 17 00:00:00 2001 From: haranp Date: Thu, 5 Feb 2009 14:09:48 +0000 Subject: Possible fix for 2530342: full_describe_view() iterating over the viewport instead of over LOS squares. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8901 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/debug.cc | 10 ++++++++-- crawl-ref/source/directn.cc | 21 ++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 10fc310b18..eb83f333a8 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -78,6 +78,7 @@ REVISION("$Rev$"); #include "spl-cast.h" #include "spl-mis.h" #include "spl-util.h" +#include "stash.h" #include "state.h" #include "stuff.h" #include "terrain.h" @@ -1327,8 +1328,13 @@ void wizard_create_spec_object() // orig_monnum is used in corpses for things like the Animate // Dead spell, so leave it alone. if (class_wanted != OBJ_CORPSES) - origin_acquired( mitm[thing_created], AQ_WIZMODE ); - canned_msg( MSG_SOMETHING_APPEARS ); + origin_acquired(mitm[thing_created], AQ_WIZMODE); + canned_msg(MSG_SOMETHING_APPEARS); + + // Tell the stash tracker. + StashTrack.update_visible_stashes( + Options.stash_tracking == STM_ALL ? StashTracker::ST_AGGRESSIVE + : StashTracker::ST_PASSIVE); } } diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index b2c8247267..9a10ab20b3 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -450,27 +450,26 @@ static void _describe_monster(const monsters *mon); // TODO: Allow sorting of items lists. void full_describe_view() { - const coord_def start = view2grid(coord_def(1,1)); - const coord_def end = start + crawl_view.viewsz - coord_def(1,1); - std::vector list_mons; std::vector list_items; - // Iterate over viewport and grab all items known (or thought) - // to be in the stashes in view. - for (rectangle_iterator ri(start, end); ri; ++ri) + // Grab all items known (or thought) to be in the stashes in view. + for (radius_iterator ri(you.pos(), LOS_RADIUS); ri; ++ri) { - if (!in_bounds(*ri) || !see_grid(*ri)) - continue; - const int oid = igrd(*ri); - if (oid == NON_ITEM) continue; std::vector items = item_list_in_stash(*ri); + +#ifdef DEBUG_DIAGNOSTICS if (items.empty()) - continue; + { + mprf(MSGCH_ERROR, "No items found in stash, but top item is %s", + mitm[oid].name(DESC_PLAIN).c_str()); + more(); + } +#endif list_items.insert(list_items.end(), items.begin(), items.end()); } -- cgit v1.2.3-54-g00ecf