Core/Auras: Add Aura::TryRefreshStackOrCreate function and remove stack checks from Aura::Create
This commit is contained in:
@@ -3815,7 +3815,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
|
||||
if (aura->IsSingleTarget())
|
||||
aura->UnregisterSingleTarget();
|
||||
|
||||
if (newAura = Aura::TryCreate(aura->GetSpellProto(), effMask, stealer, NULL, &baseDamage[0], NULL, aura->GetCasterGUID()))
|
||||
if (newAura = Aura::TryRefreshStackOrCreate(aura->GetSpellProto(), effMask, stealer, NULL, &baseDamage[0], NULL, aura->GetCasterGUID()))
|
||||
{
|
||||
// created aura must not be single target aura,, so stealer won't loose it on recast
|
||||
if (newAura->IsSingleTarget())
|
||||
@@ -16184,7 +16184,7 @@ Aura * Unit::AddAura(SpellEntry const *spellInfo, uint8 effMask, Unit *target)
|
||||
effMask &= ~(1<<i);
|
||||
}
|
||||
|
||||
if (Aura * aura = Aura::TryCreate(spellInfo, effMask, target, this))
|
||||
if (Aura * aura = Aura::TryRefreshStackOrCreate(spellInfo, effMask, target, this))
|
||||
{
|
||||
aura->ApplyForTargets();
|
||||
return aura;
|
||||
@@ -16765,7 +16765,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
else // This can happen during Player::_LoadAuras
|
||||
{
|
||||
int32 bp0 = seatId;
|
||||
Aura::TryCreate(spellEntry, this, clicker, &bp0, NULL, origCasterGUID);
|
||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, &bp0, NULL, origCasterGUID);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -16773,7 +16773,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
if (IsInMap(caster))
|
||||
caster->CastSpell(target, spellEntry, true, NULL, NULL, origCasterGUID);
|
||||
else
|
||||
Aura::TryCreate(spellEntry, this, clicker, NULL, NULL, origCasterGUID);
|
||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID);
|
||||
}
|
||||
|
||||
success = true;
|
||||
|
||||
Reference in New Issue
Block a user