summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-02 20:08:39 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-02 20:08:39 +0000
commit7d7691a8ba1924cc04f477978ecd771026a70cc0 (patch)
tree0af758dd3081aa656ab75ba9fdd894b5c06020c0 /crawl-ref/source/spells4.cc
parentc437c2564a45a47726a2a6aca313834ad27d6a4d (diff)
downloadcrawl-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/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc19
1 files changed, 6 insertions, 13 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index d232ed51b9..4384a84ced 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -1464,24 +1464,17 @@ void cast_fulsome_distillation( int powc )
int corpse = -1;
- // Search items at the players location for corpses.
- // XXX: Turn this into a separate function and merge with
- // the messes over in butchery, animating, and maybe even
- // item pickup from stacks (which would make it easier to
- // create a floor stack menu system later) -- bwr
- for (int curr_item = igrd[you.x_pos][you.y_pos];
- curr_item != NON_ITEM;
- curr_item = mitm[curr_item].link)
- {
- const item_def& item = mitm[curr_item];
- if (item.base_type == OBJ_CORPSES && item.sub_type == CORPSE_BODY)
+ // Search items at the player's location for corpses.
+ for (stack_iterator si(you.pos()); si; ++si)
+ {
+ if (si->base_type == OBJ_CORPSES && si->sub_type == CORPSE_BODY)
{
snprintf( info, INFO_SIZE, "Distill a potion from %s?",
- item.name(DESC_NOCAP_THE).c_str() );
+ si->name(DESC_NOCAP_THE).c_str() );
if (yesno( info, true, 0, false ))
{
- corpse = curr_item;
+ corpse = si->index();
break;
}
}