From b1c2d6e096eebdbae0c2f5a8dd48a5f67a1eb678 Mon Sep 17 00:00:00 2001 From: haranp Date: Thu, 25 Dec 2008 17:04:20 +0000 Subject: Complete rewrite of the beam code, making it considerably saner. However, there might be quite a few bugs lurking in this rewrite. Sorry. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7975 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/item_use.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/item_use.cc') diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 2c9be93581..7d638147b1 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1873,7 +1873,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, pbolt.foe_helped = pbolt.foe_hurt = 0; pbolt.foe_ratio = 100; - fire_beam(pbolt); + pbolt.fire(); // Should only happen if the player answered 'n' to one of those // "Fire through friendly?" prompts. @@ -2588,9 +2588,10 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, if (teleport) { // Violating encapsulation somewhat...oh well. - hit = (affect(pbolt, pbolt.target, &item) != 0); + pbolt.use_target_as_pos = true; + pbolt.affect_cell(); if (acc_bonus != DEBUG_COOKIE) - beam_drop_object(pbolt, &item, pbolt.target); + pbolt.drop_object(); } else { @@ -2599,7 +2600,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, // Dropping item copy, since the launched item might be different. pbolt.drop_item = !did_return; - fire_beam(pbolt); + pbolt.fire(); // The item can be destroyed before returning. if (did_return && thrown_object_destroyed(&item, pbolt.target, true)) @@ -2617,7 +2618,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, // Fire beam in reverse. pbolt.setup_retrace(); viewwindow(true, false); - fire_beam(pbolt); + pbolt.fire(); msg::stream << item.name(DESC_CAP_THE) << " returns to your pack!" << std::endl; -- cgit v1.2.3-54-g00ecf