aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2010-01-22 18:06:01 +0100
committerQAston <none@none>2010-01-22 18:06:01 +0100
commitc1aa60aaab82733ebb91ce31281f85edf8e7618d (patch)
tree44de82d7e0df6d141c0e38175ad91eedd46e1575 /src/game/SpellAuras.cpp
parent7bfea3fea3397f936046c1856840a3a9def8ee6a (diff)
*Run grid searches for area auras every 500ms instead of every unit update
*Fix a stupid typo which caused memory leak in Unit::RemoveOwnedAura --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index a3128ba7567..ebdd2747181 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -332,7 +332,7 @@ Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * o
Aura::Aura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID) :
m_spellProto(spellproto), m_owner(owner), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()), m_castItemGuid(castItem ? castItem->GetGUID() : 0),
- m_applyTime(time(NULL)), m_timeCla(0), m_isSingleTarget(false),
+ m_applyTime(time(NULL)), m_timeCla(0), m_isSingleTarget(false), m_updateTargetMapInterval(0),
m_procCharges(0), m_stackAmount(1), m_isRemoved(false), m_casterLevel(caster ? caster->getLevel() : m_spellProto->spellLevel)
{
if(m_spellProto->manaPerSecond || m_spellProto->manaPerSecondPerLevel)
@@ -453,6 +453,7 @@ void Aura::_Remove(AuraRemoveMode removeMode)
void Aura::UpdateTargetMap(Unit * caster)
{
+ m_updateTargetMapInterval = UPDATE_TARGET_MAP_INTERVAL;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if(m_effects[i] && !IsRemoved())
UpdateTargetMapForEffect(caster, i);
@@ -474,7 +475,10 @@ void Aura::UpdateOwner(uint32 diff, WorldObject * owner)
Update(diff, caster);
- UpdateTargetMap(caster);
+ if (m_updateTargetMapInterval <= diff)
+ UpdateTargetMap(caster);
+ else
+ m_updateTargetMapInterval -= diff;
// update aura effects
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)