aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-09 22:31:53 -0500
committermegamage <none@none>2009-05-09 22:31:53 -0500
commit883c2ef77da57f12887cfcdbaed03bf1ea50e6b9 (patch)
tree9af1daa29cfacf371ef41a4b36a3ab9b976fa8ca /src/game/Unit.cpp
parent67876f9dfe14783e9c81bf5a8bab6843d30b22bc (diff)
*Do not allow persistant auras from the same caster stack on target.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 6bd9c52c7d5..7a3385acabf 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -13610,16 +13610,12 @@ void Unit::AddAura(uint32 spellId, Unit* target)
target->AddAura(Aur);
}
-Aura * Unit::AddAuraEffect(uint32 spellId, uint8 effIndex, Unit* caster, int32 * basePoints)
+Aura * Unit::AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* caster, int32 * basePoints)
{
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
- if(!spellInfo || !caster)
- return NULL;
-
// can't do that for passive auras - they stack from same caster so there is no way to get exact aura which should get effect
//assert (!IsPassiveSpell(spellInfo));
- Aura * aur = GetAura(spellId, caster->GetGUID());
+ Aura *aur = GetAura(spellInfo->Id, caster->GetGUID());
if (aur)
{
@@ -13636,10 +13632,10 @@ Aura * Unit::AddAuraEffect(uint32 spellId, uint8 effIndex, Unit* caster, int32 *
aur = new Aura(spellInfo, 1<<effIndex, amount, this ,caster);
}
else
- {
aur = new Aura(spellInfo, 1<<effIndex, NULL, this ,caster);
- }
- AddAura(aur);
+
+ if(!AddAura(aur))
+ return NULL;
}
return aur;
}