Core/Spells: Refactored SpellInfo::CalcCastTime() to prevent accidental mod charge losses caused by its incorrect usage

This commit is contained in:
Shauren committed 2013-08-15 16:37:18 +02:00
1 parent d1bb6da668
commit c52f9aa315
3 files changed
+16 -14

No files matched your search

+3 -3
View File
@@ -2057,7 +2057,7 @@ int32 SpellInfo::GetMaxDuration() const
return (DurationEntry->Duration[2] == -1) ? -1 : abs(DurationEntry->Duration[2]);
}
uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const
uint32 SpellInfo::CalcCastTime(Spell* spell /*= NULL*/) const
{
// not all spells have cast time index and this is all is pasiive abilities
if (!CastTimeEntry)
@@ -2065,8 +2065,8 @@ uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const
int32 castTime = CastTimeEntry->CastTime;
if (caster)
caster->ModSpellCastTime(this, castTime, spell);
if (spell)
spell->GetCaster()->ModSpellCastTime(this, castTime, spell);
if (Attributes & SPELL_ATTR0_REQ_AMMO && (!IsAutoRepeatRangedSpell()))
castTime += 500;