aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkaelima <kaelima@live.se>2011-12-21 02:12:46 +0100
committerkaelima <kaelima@live.se>2011-12-21 02:12:46 +0100
commit2f2b84f6e58107f8ae237749299f95d89ed93b23 (patch)
tree48344208aba7ed898516a7ac41eb2d9aad18a663 /src
parent6ccf95af4c5ce24cf6eecc49830dd0d714184ff6 (diff)
Core/Spells: Fix some possible crashes in HandleAuraDummy, caster can be null for auras.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 140d818c775..12c40c15db4 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -4794,10 +4794,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break;
case 63322: // Saronite Vapors
{
- int32 mana = int32(GetAmount() * pow(2.0f, GetBase()->GetStackAmount())); // mana restore - bp * 2^stackamount
- int32 damage = mana * 2; // damage
- caster->CastCustomSpell(target, 63337, &mana, NULL, NULL, true);
- caster->CastCustomSpell(target, 63338, &damage, NULL, NULL, true);
+ if (caster)
+ {
+ int32 mana = int32(GetAmount() * pow(2.0f, GetBase()->GetStackAmount())); // mana restore - bp * 2^stackamount
+ int32 damage = mana * 2; // damage
+ caster->CastCustomSpell(target, 63337, &mana, NULL, NULL, true);
+ caster->CastCustomSpell(target, 63338, &damage, NULL, NULL, true);
+ }
break;
}
case 71563:
@@ -4805,9 +4808,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
break;
case 59628: // Tricks of the Trade
- if (!caster->GetMisdirectionTarget())
- break;
- target->SetReducedThreatPercent(100,caster->GetMisdirectionTarget()->GetGUID());
+ if (caster && caster->GetMisdirectionTarget())
+ target->SetReducedThreatPercent(100, caster->GetMisdirectionTarget()->GetGUID());
break;
}
}
@@ -5208,7 +5210,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (!(mode & AURA_EFFECT_HANDLE_REAL))
break;
// Sentry Totem
- if (GetId() == 6495 && caster->GetTypeId() == TYPEID_PLAYER)
+ if (GetId() == 6495 && caster && caster->GetTypeId() == TYPEID_PLAYER)
{
if (apply)
{