Core/Spells: Fix some possible crashes in HandleAuraDummy, caster can be null for auras.
This commit is contained in:
@@ -4794,10 +4794,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
|||||||
break;
|
break;
|
||||||
case 63322: // Saronite Vapors
|
case 63322: // Saronite Vapors
|
||||||
{
|
{
|
||||||
int32 mana = int32(GetAmount() * pow(2.0f, GetBase()->GetStackAmount())); // mana restore - bp * 2^stackamount
|
if (caster)
|
||||||
int32 damage = mana * 2; // damage
|
{
|
||||||
caster->CastCustomSpell(target, 63337, &mana, NULL, NULL, true);
|
int32 mana = int32(GetAmount() * pow(2.0f, GetBase()->GetStackAmount())); // mana restore - bp * 2^stackamount
|
||||||
caster->CastCustomSpell(target, 63338, &damage, NULL, NULL, true);
|
int32 damage = mana * 2; // damage
|
||||||
|
caster->CastCustomSpell(target, 63337, &mana, NULL, NULL, true);
|
||||||
|
caster->CastCustomSpell(target, 63338, &damage, NULL, NULL, true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 71563:
|
case 71563:
|
||||||
@@ -4805,9 +4808,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
|||||||
newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
|
newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
|
||||||
break;
|
break;
|
||||||
case 59628: // Tricks of the Trade
|
case 59628: // Tricks of the Trade
|
||||||
if (!caster->GetMisdirectionTarget())
|
if (caster && caster->GetMisdirectionTarget())
|
||||||
break;
|
target->SetReducedThreatPercent(100, caster->GetMisdirectionTarget()->GetGUID());
|
||||||
target->SetReducedThreatPercent(100,caster->GetMisdirectionTarget()->GetGUID());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5208,7 +5210,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
|||||||
if (!(mode & AURA_EFFECT_HANDLE_REAL))
|
if (!(mode & AURA_EFFECT_HANDLE_REAL))
|
||||||
break;
|
break;
|
||||||
// Sentry Totem
|
// Sentry Totem
|
||||||
if (GetId() == 6495 && caster->GetTypeId() == TYPEID_PLAYER)
|
if (GetId() == 6495 && caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
if (apply)
|
if (apply)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user