From c3c36ec1c8cac02f402c344c07694b24390901a7 Mon Sep 17 00:00:00 2001 From: QAston Date: Tue, 3 Feb 2009 18:27:22 +0100 Subject: *Fix bug that missed/immuned/etc. shoots take no ammo. *Handle SPELL_AURA_ABILITY_CONSUME_NO_AMMO --HG-- branch : trunk --- src/game/SpellEffects.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/game/SpellEffects.cpp') diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 2ef4a3827c4..4e6e29aaf8c 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4575,33 +4575,6 @@ void Spell::SpellDamageWeaponDmg(uint32 i) // Add melee damage bonuses (also check for negative) m_caster->MeleeDamageBonus(unitTarget, &eff_damage, m_attackType, m_spellInfo); m_damage+= eff_damage; - - // take ammo - if(m_attackType == RANGED_ATTACK && m_caster->GetTypeId() == TYPEID_PLAYER) - { - Item *pItem = ((Player*)m_caster)->GetWeaponForAttack( RANGED_ATTACK ); - - // wands don't have ammo - if(!pItem || pItem->IsBroken() || pItem->GetProto()->SubClass==ITEM_SUBCLASS_WEAPON_WAND) - return; - - if( pItem->GetProto()->InventoryType == INVTYPE_THROWN ) - { - if(pItem->GetMaxStackCount()==1) - { - // decrease durability for non-stackable throw weapon - ((Player*)m_caster)->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED); - } - else - { - // decrease items amount for stackable throw weapon - uint32 count = 1; - ((Player*)m_caster)->DestroyItemCount( pItem, count, true); - } - } - else if(uint32 ammo = ((Player*)m_caster)->GetUInt32Value(PLAYER_AMMO_ID)) - ((Player*)m_caster)->DestroyItemCount(ammo, 1, true); - } } void Spell::EffectThreat(uint32 /*i*/) -- cgit v1.2.3