summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorStefan O'Rear <stefanor@cox.net>2009-12-29 22:43:19 -0800
committerStefan O'Rear <stefanor@cox.net>2009-12-29 22:44:54 -0800
commit8a504d20b9992fea2daac06faa6ca5559ca63ae0 (patch)
tree2e809b12b5e1020ebe4ee3237025081d5cd22816 /crawl-ref/source/effects.cc
parent75c0968931bf47f6f718b91ce3f589cd9f815298 (diff)
downloadcrawl-ref-8a504d20b9992fea2daac06faa6ca5559ca63ae0.tar.gz
crawl-ref-8a504d20b9992fea2daac06faa6ca5559ca63ae0.zip
Give move/copy_item_to_grid responsibility for hazardous terrain
We now have much less duplication of logic, yay.
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc23
1 files changed, 5 insertions, 18 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index bede6d46c2..dcec8a0373 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -2315,14 +2315,12 @@ int acquirement_create_item(object_class_type class_wanted,
if (agent > GOD_NO_GOD && agent < NUM_GODS && agent == you.religion)
thing.inscription = "god gift";
- move_item_to_grid( &thing_created, pos );
-
- // This should never actually be NON_ITEM because of the way
- // move_item_to_grid works (doesn't create a new item ever),
- // but we're checking it anyways. -- bwr
+ // Moving this above the move since it might not exist after falling.
if (thing_created != NON_ITEM && !quiet)
canned_msg(MSG_SOMETHING_APPEARS);
+ move_item_to_grid( &thing_created, pos );
+
return (thing_created);
}
@@ -2382,10 +2380,6 @@ bool acquirement(object_class_type class_wanted, int agent,
if (feat_destroys_items(grd(you.pos())))
{
- // How sad (and stupid).
- if (!silenced(you.pos()) && !quiet)
- mprf(MSGCH_SOUND, feat_item_destruction_message(grd(you.pos())));
-
if (agent > GOD_NO_GOD && agent < NUM_GODS)
{
if (agent == GOD_XOM)
@@ -2399,18 +2393,11 @@ bool acquirement(object_class_type class_wanted, int agent,
god_name((god_type) agent).c_str());
}
}
-
- *item_index = NON_ITEM;
-
- // Well, the item may have fallen in the drink, but the intent is
- // that acquirement happened. -- bwr
- return (true);
}
- *item_index =
- acquirement_create_item(class_wanted, agent, quiet, you.pos(), debug);
+ acquirement_create_item(class_wanted, agent, quiet, you.pos(), debug);
- return (*item_index != NON_ITEM);
+ return (true);
}
bool recharge_wand(int item_slot)