aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellInfo.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-08-15 16:37:18 +0200
committerShauren <shauren.trinity@gmail.com>2013-08-15 16:37:18 +0200
commitc52f9aa3157bddc7dffb67ac03b3bfdf7977c55c (patch)
treecffd68d7f524fa79d8da7fc117c385f6a984d290 /src/server/game/Spells/SpellInfo.cpp
parentd1bb6da668c15e6b359c7b1ef0287d1004fcbe58 (diff)
Core/Spells: Refactored SpellInfo::CalcCastTime() to prevent accidental mod charge losses caused by its incorrect usage
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 3ac1351c135..04437b82f2d 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -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;