summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-05 14:09:48 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-05 14:09:48 +0000
commitf69ba51dd364f66462af1a099193de467312407f (patch)
tree8284e9ad7518d3d75de4806ce33876a8b2402e45 /crawl-ref
parent37a8bc70c5fab0c3e50a0ea735f562d4089e5283 (diff)
downloadcrawl-ref-f69ba51dd364f66462af1a099193de467312407f.tar.gz
crawl-ref-f69ba51dd364f66462af1a099193de467312407f.zip
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
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/debug.cc10
-rw-r--r--crawl-ref/source/directn.cc21
2 files changed, 18 insertions, 13 deletions
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<const monsters*> list_mons;
std::vector<item_def> 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<item_def> 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());
}