mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-14 16:03:45 +00:00
fix(Core/Spells): add several missing null checks for the DamageInfo struct to fix a crash (#8322)
This commit is contained in:
@@ -824,7 +824,15 @@ public:
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
int32 heal = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount());
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int32 heal = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
|
||||
GetTarget()->CastCustomSpell(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), TRIGGERED_FULL_MASK, nullptr, aurEff);
|
||||
}
|
||||
|
||||
|
||||
@@ -3536,7 +3536,15 @@ public:
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
int32 heal = int32(eventInfo.GetDamageInfo()->GetDamage() / 2);
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int32 heal = static_cast<int32>(damageInfo->GetDamage() / 2);
|
||||
GetTarget()->CastCustomSpell(SPELL_DARK_HUNGER_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
|
||||
@@ -657,7 +657,15 @@ public:
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
int32 amount = aurEff->GetAmount() + eventInfo.GetDamageInfo()->GetDamage();
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int32 amount = aurEff->GetAmount() + damageInfo->GetDamage();
|
||||
|
||||
uint8 num = amount / 15000;
|
||||
if (amount >= 15000)
|
||||
|
||||
@@ -2971,8 +2971,15 @@ public:
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
int32 damage = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), 60);
|
||||
GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetDamageInfo()->GetAttacker(), true, nullptr, aurEff);
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int32 damage = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), 60);
|
||||
GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, damageInfo->GetAttacker(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
Reference in New Issue
Block a user