diff options
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r-- | crawl-ref/source/item_use.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 266d4fef52..f6bbc3fe26 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2277,11 +2277,20 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, item_def& thrown = you.inv[throw_2]; ASSERT(is_valid_item(thrown)); + // Figure out if we're thrown or launched. + const launch_retval projected = is_launched(&you, you.weapon(), thrown); + // Making a copy of the item: changed only for venom launchers. item_def item = thrown; item.quantity = 1; item.slot = index_to_letter(item.link); + // Items that get a temporary brand from a player spell lose the + // brand as soon as the player lets go of the item. Can't call + // unwield_item() yet since the beam might get canceled. + if (you.duration[DUR_WEAPON_BRAND] && projected == LRET_THROWN) + set_item_ego_type( item, OBJ_WEAPONS, SPWPN_NORMAL ); + std::string ammo_name; setup_missile_beam(&you, pbolt, item, ammo_name, returning); @@ -2292,9 +2301,6 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, const object_class_type wepClass = thrown.base_type; const int wepType = thrown.sub_type; - // Figure out if we're thrown or launched. - const launch_retval projected = is_launched(&you, you.weapon(), thrown); - // Determine range. int max_range = 0; int range = 0; @@ -2359,12 +2365,11 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, // Use real range for firing. pbolt.range = range; - // Must unwield before making a copy in order to remove things - // like temporary branding. + bool unwielded = false; if (throw_2 == you.equip[EQ_WEAPON] && thrown.quantity == 1) { unwield_item(); - canned_msg(MSG_EMPTY_HANDED); + unwielded = true; } // Now start real firing! @@ -2991,6 +2996,8 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, << " fails to return to your pack!" << std::endl; } dec_inv_item_quantity(throw_2, 1); + if (unwielded) + canned_msg(MSG_EMPTY_HANDED); } // Throwing and blowguns are silent... |