diff options
author | Stefan O'Rear <stefanor@cox.net> | 2009-12-29 22:43:19 -0800 |
---|---|---|
committer | Stefan O'Rear <stefanor@cox.net> | 2009-12-29 22:44:54 -0800 |
commit | 8a504d20b9992fea2daac06faa6ca5559ca63ae0 (patch) | |
tree | 2e809b12b5e1020ebe4ee3237025081d5cd22816 /crawl-ref/source/misc.cc | |
parent | 75c0968931bf47f6f718b91ce3f589cd9f815298 (diff) | |
download | crawl-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/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 4bac2e7ff0..b9d9fdabb3 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1041,23 +1041,18 @@ void split_potions_into_decay( int obj, int amount, bool need_msg ) } } - // Only bother creating a distinct stack of potions - // if it won't get destroyed right away. - if (!feat_destroys_items(grd(you.pos()))) - { - item_def potion2; - potion2.base_type = OBJ_POTIONS; - potion2.sub_type = POT_DECAY; - // Keep description as it was. - potion2.plus = potion.plus; - potion2.quantity = amount; - potion2.colour = potion.colour; - potion2.plus2 = 0; - potion2.flags = 0; - potion2.special = 0; - - copy_item_to_grid(potion2, you.pos()); - } + item_def potion2; + potion2.base_type = OBJ_POTIONS; + potion2.sub_type = POT_DECAY; + // Keep description as it was. + potion2.plus = potion.plus; + potion2.quantity = amount; + potion2.colour = potion.colour; + potion2.plus2 = 0; + potion2.flags = 0; + potion2.special = 0; + + copy_item_to_grid(potion2, you.pos()); // Is decreased even if the decay stack goes splat. dec_inv_item_quantity(obj, amount); |