summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-02 19:51:50 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-02 19:51:50 +0000
commit4293d91bfd7e4b10b7cdee76dc7d5da7e5e3e001 (patch)
tree071c35be0b6d5541418b190765e47591ca0229b5 /crawl-ref/source/item_use.cc
parent8030e3981a5ff0333ae659cbd08763c09ffdede0 (diff)
downloadcrawl-ref-4293d91bfd7e4b10b7cdee76dc7d5da7e5e3e001.tar.gz
crawl-ref-4293d91bfd7e4b10b7cdee76dc7d5da7e5e3e001.zip
Many code cleanups, mostly involving using stack_iterator and
radius_iterator instead of the previous setup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6347 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 2bb692af9c..2eb1259aa8 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1777,20 +1777,12 @@ static int dex_adjust_thrown_tohit(int hit)
static void identify_floor_missiles_matching(item_def mitem, int idflags)
{
mitem.flags &= ~idflags;
- int item = NON_ITEM;
+
for (int y = 0; y < GYM; ++y)
for (int x = 0; x < GXM; ++x)
- {
- item = igrd[x][y];
- while (item != NON_ITEM)
- {
- item_def &i(mitm[item]);
- item = i.link;
-
- if ((i.flags & ISFLAG_THROWN) && items_stack(i, mitem))
- i.flags |= idflags;
- }
- }
+ for ( stack_iterator si(coord_def(x,y)); si; ++si )
+ if ((si->flags & ISFLAG_THROWN) && items_stack(*si, mitem))
+ si->flags |= idflags;
}
// throw_it - currently handles player throwing only. Monster