From 4293d91bfd7e4b10b7cdee76dc7d5da7e5e3e001 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 2 Jul 2008 19:51:50 +0000 Subject: 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 --- crawl-ref/source/item_use.cc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/item_use.cc') 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 -- cgit v1.2.3-54-g00ecf