refactor(Core): replace NULL with nullptr (#4593)

This commit is contained in:
Kitzunu
2021-03-02 01:34:20 +01:00
committed by GitHub
parent dbefa17a53
commit 28f1dc5c0c
231 changed files with 923 additions and 923 deletions

View File

@@ -1120,7 +1120,7 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
CallScriptObjectTargetSelectHandlers(target, effIndex, targetType);
if (!target)
{
//TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id %u set NULL target, effect %u", m_spellInfo->Id, effIndex);
//TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id %u set nullptr target, effect %u", m_spellInfo->Id, effIndex);
return;
}
@@ -3026,7 +3026,7 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo* target)
for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
if (effectMask & (1 << effectNumber))
HandleEffects(nullptr, NULL, go, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
HandleEffects(nullptr, nullptr, go, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
// xinef: inform ai about spellhit
go->AI()->SpellHit(m_caster, m_spellInfo);
@@ -3047,7 +3047,7 @@ void Spell::DoAllEffectOnTarget(ItemTargetInfo* target)
for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
if (effectMask & (1 << effectNumber))
HandleEffects(nullptr, target->item, NULL, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
HandleEffects(nullptr, target->item, nullptr, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
CallScriptOnHitHandlers();
@@ -3343,7 +3343,7 @@ SpellCastResult Spell::prepare(SpellCastTargets const* targets, AuraEffect const
{
// Xinef: Creature should focus to cast target if there is explicit target or self if casting positive spell
// Xinef: Creature should not rotate like a retard when casting spell... based on halion behavior
m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget() != NULL ? m_targets.GetObjectTarget() : m_caster);
m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget() != nullptr ? m_targets.GetObjectTarget() : m_caster);
}
}
@@ -3610,7 +3610,7 @@ void Spell::_cast(bool skipCheck)
// Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells
if ((m_spellInfo->Speed > 0.0f && !m_spellInfo->IsChanneled())/* xinef: we dont need this shit || m_spellInfo->Id == 14157*/)
{
// Remove used for cast item if need (it can be already NULL after TakeReagents call
// Remove used for cast item if need (it can be already nullptr after TakeReagents call
// in case delayed spell remove item at cast delay start
TakeCastItem();
@@ -3654,7 +3654,7 @@ void Spell::_cast(bool skipCheck)
}
// Interrupt Spell casting
// handle this here, in other places SpellHitTarget can be set to NULL, if there is an error in this function
// handle this here, in other places SpellHitTarget can be set to nullptr, if there is an error in this function
if (m_spellInfo->HasAttribute(SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER))
if (Unit* target = m_targets.GetUnitTarget())
if (target->GetTypeId() == TYPEID_UNIT)
@@ -3719,7 +3719,7 @@ void Spell::handle_immediate()
// spell is finished, perform some last features of the spell here
_handle_finish_phase();
// Remove used for cast item if need (it can be already NULL after TakeReagents call
// Remove used for cast item if need (it can be already nullptr after TakeReagents call
TakeCastItem();
// handle ammo consumption for Hunter's volley spell
@@ -5312,7 +5312,7 @@ SpellCastResult Spell::CheckCast(bool strict)
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id);
if (!conditions.empty() && !sConditionMgr->IsObjectMeetToConditions(condInfo, conditions))
{
// mLastFailedCondition can be NULL if there was an error processing the condition in Condition::Meets (i.e. wrong data for ConditionTarget or others)
// mLastFailedCondition can be nullptr if there was an error processing the condition in Condition::Meets (i.e. wrong data for ConditionTarget or others)
if (condInfo.mLastFailedCondition && condInfo.mLastFailedCondition->ErrorType)
{
if (condInfo.mLastFailedCondition->ErrorType == SPELL_FAILED_CUSTOM_ERROR)