diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-02 20:08:39 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-02 20:08:39 +0000 |
commit | 7d7691a8ba1924cc04f477978ecd771026a70cc0 (patch) | |
tree | 0af758dd3081aa656ab75ba9fdd894b5c06020c0 /crawl-ref/source/traps.cc | |
parent | c437c2564a45a47726a2a6aca313834ad27d6a4d (diff) | |
download | crawl-ref-7d7691a8ba1924cc04f477978ecd771026a70cc0.tar.gz crawl-ref-7d7691a8ba1924cc04f477978ecd771026a70cc0.zip |
A few more cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6349 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r-- | crawl-ref/source/traps.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index d321f6e860..5822d624f3 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -49,17 +49,13 @@ static void dart_trap(bool trap_known, int trapped, bolt &pbolt, bool poison); // otherwise the first net found is returned. int get_trapping_net(int x, int y, bool trapped) { - int net, next; - - for (net = igrd[x][y]; net != NON_ITEM; net = next) + for (stack_iterator si(coord_def(x,y)); si; ++si) { - next = mitm[net].link; - - if (mitm[net].base_type == OBJ_MISSILES - && mitm[net].sub_type == MI_THROWING_NET - && (!trapped || item_is_stationary(mitm[net]))) + if (si->base_type == OBJ_MISSILES + && si->sub_type == MI_THROWING_NET + && (!trapped || item_is_stationary(*si))) { - return (net); + return (si->index()); } } return (NON_ITEM); |