Fixes ammo consumption for Hunter's Volley

#2734
This commit is contained in:
hacknowledge
2011-08-24 23:26:25 +02:00
parent f72cff430d
commit eb15c8c08a

View File

@@ -3289,6 +3289,11 @@ void Spell::handle_immediate()
// Remove used for cast item if need (it can be already NULL after TakeReagents call
TakeCastItem();
// handle ammo consumption for Hunter's volley spell
if (IsRangedWeaponSpell(m_spellInfo) && IsChanneledSpell(m_spellInfo))
TakeAmmo();
if (m_spellState != SPELL_STATE_CASTING)
finish(true); // successfully finish spell cast (not last in case autorepeat or channel spell)
}
@@ -6639,6 +6644,10 @@ void Spell::CalculateDamageDoneForAllTargets()
if (!unit) // || !unit->isAlive()) do we need to check alive here?
continue;
// do not consume ammo anymore for Hunter's volley spell
if (IsTriggered() && m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && IsAreaOfEffectSpell(m_spellInfo))
usesAmmo = false;
if (usesAmmo)
{
bool ammoTaken = false;