chore(Core/Misc): nullptr cleanup (#11467)

This commit is contained in:
Kitzunu
2022-04-21 19:17:20 +02:00
committed by GitHub
parent eb91bbfc56
commit 1501445b0a
23 changed files with 60 additions and 69 deletions

View File

@@ -8943,7 +8943,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
// All ok. Check current trigger spell
SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(trigger_spell_id);
if (triggerEntry == nullptr)
if (!triggerEntry)
{
// Don't cast unknown spell
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell {} (effIndex: {}) has unknown TriggerSpell {}. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex(), trigger_spell_id);
@@ -9386,7 +9386,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
}
// try detect target manually if not set
if (target == nullptr)
if (!target)
target = !(procFlags & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry->IsPositive() ? this : victim;
if (cooldown)
@@ -15761,7 +15761,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
continue;
// If not trigger by default and spellProcEvent == nullptr - skip
if (!isTriggerAura[aurEff->GetAuraType()] && triggerData.spellProcEvent == nullptr)
if (!isTriggerAura[aurEff->GetAuraType()] && !triggerData.spellProcEvent)
continue;
switch (aurEff->GetAuraType())