Core/Auras: Fixed crash happening when a periodic aura tick triggers SPELL_AURA_SPLIT_DAMAGE_PCT

Closes #29450

(cherry picked from commit 3a50bc50a2)
This commit is contained in:
Shauren
2023-11-23 11:05:49 +01:00
committed by funjoker
parent 7aa5ffa1fa
commit fa7b01bec7
2 changed files with 3 additions and 3 deletions

View File

@@ -5284,7 +5284,7 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const* log)
{
WorldPackets::CombatLog::SpellNonMeleeDamageLog packet;
packet.Me = log->target->GetGUID();
packet.CasterGUID = log->attacker->GetGUID();
packet.CasterGUID = log->attacker ? log->attacker->GetGUID() : ObjectGuid::Empty;
packet.CastID = log->castId;
packet.SpellID = log->Spell ? log->Spell->Id : 0;
packet.Visual = log->SpellVisual;

View File

@@ -117,8 +117,8 @@ bool ContentTuningParams::GenerateDataForUnits<Creature, Creature>(Creature* att
template<>
bool ContentTuningParams::GenerateDataForUnits<Unit, Unit>(Unit* attacker, Unit* target)
{
if (Player* playerAttacker = attacker->ToPlayer())
if (Player* playerTarget = target->ToPlayer())
if (Player* playerAttacker = Object::ToPlayer(attacker))
if (Player* playerTarget = Object::ToPlayer(target))
return GenerateDataForUnits(playerAttacker, playerTarget);
return false;