diff options
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r-- | crawl-ref/source/item_use.cc | 16 |
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 |