summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-01 13:31:32 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-01 13:31:32 +0000
commit6384f9c708cf79f471df00d1e0cfa3f2c1bf4172 (patch)
treebbe2afd354784128992b48a9c243d087ffcf7145
parentb2ad1e469c8a1ed00d0e52ca1d23bb2f32d01c02 (diff)
downloadcrawl-ref-6384f9c708cf79f471df00d1e0cfa3f2c1bf4172.tar.gz
crawl-ref-6384f9c708cf79f471df00d1e0cfa3f2c1bf4172.zip
Oops, wasn't setting beam.item_pos and beam.item_index when a beam item
was dropped. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7708 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 90f636d0d0..7751bd40fd 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2830,7 +2830,6 @@ void beam_drop_object( bolt &beam, item_def *item, const coord_def& _p )
item = beam.item;
ASSERT( item != NULL );
ASSERT( is_valid_item(*item) );
- ASSERT( item->quantity > 0);
#ifdef DEBUG
if (!beam.drop_item)
@@ -2876,7 +2875,25 @@ void beam_drop_object( bolt &beam, item_def *item, const coord_def& _p )
}
if (copy_item_to_grid( *item, p, 1 ))
+ {
beam.dropped_item = true;
+ beam.item_pos = p;
+
+ // Dropped item might have merged into stack
+ if (is_stackable_item(*item))
+ {
+ for (stack_iterator si(p); si; ++si)
+ {
+ if (items_stack(*item, *si))
+ {
+ beam.item_index = si->index();
+ break;
+ }
+ }
+ }
+ else
+ beam.item_index = igrd(p);
+ }
else
{
#ifdef DEBUG