refactor(Core): NULL -> nullptr (#3275)

* NULL to nullptr

* NULL to nullptr

* NULL to nullptr

* NULL to nullptr

* NULL to nullptr

Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
Kitzunu
2020-08-31 11:55:09 +02:00
committed by GitHub
parent 38903b5dfb
commit 1f89282b22
325 changed files with 2348 additions and 2348 deletions

View File

@@ -410,7 +410,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
// Conflagrate - consumes Immolate or Shadowflame
else if (m_spellInfo->TargetAuraState == AURA_STATE_CONFLAGRATE)
{
AuraEffect const* aura = NULL; // found req. aura for damage calculation
AuraEffect const* aura = nullptr; // found req. aura for damage calculation
Unit::AuraEffectList const &mPeriodic = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
for (Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
@@ -463,7 +463,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
if (AuraEffect* aurEff = owner->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, 214, 0))
{
int32 bp0 = aurEff->GetId() == 54037 ? 4 : 8;
m_caster->CastCustomSpell(m_caster, 54425, &bp0, NULL, NULL, true);
m_caster->CastCustomSpell(m_caster, 54425, &bp0, nullptr, nullptr, true);
}
}
}
@@ -706,7 +706,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
case 17731:
case 69294:
{
if( !gameObjTarget || gameObjTarget->GetRespawnTime() > time(NULL) )
if( !gameObjTarget || gameObjTarget->GetRespawnTime() > time(nullptr) )
return;
gameObjTarget->SetRespawnTime(10);
@@ -963,7 +963,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
m_caster->ToPlayer()->RemoveSpellCooldown(spellInfo->Id);
// original caster guid only for GO cast
m_caster->CastSpell(targets, spellInfo, &values, TriggerCastFlags(TRIGGERED_FULL_MASK&~TRIGGERED_NO_PERIODIC_RESET), NULL, NULL, m_originalCasterGUID);
m_caster->CastSpell(targets, spellInfo, &values, TriggerCastFlags(TRIGGERED_FULL_MASK&~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, m_originalCasterGUID);
}
void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
@@ -1018,7 +1018,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
m_caster->ToPlayer()->RemoveSpellCooldown(spellInfo->Id);
// original caster guid only for GO cast
m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, NULL, NULL, m_originalCasterGUID);
m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, nullptr, nullptr, m_originalCasterGUID);
}
void Spell::EffectForceCast(SpellEffIndex effIndex)
@@ -1050,7 +1050,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex)
break;
case 52463: // Hide In Mine Car
case 52349: // Overtake
unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, NULL, NULL, true, NULL, NULL, m_originalCasterGUID);
unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, nullptr, nullptr, true, nullptr, nullptr, m_originalCasterGUID);
return;
case 72378: // Blood Nova
case 73058: // Blood Nova
@@ -1405,7 +1405,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex)
&& effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;
WorldObject* target = NULL;
WorldObject* target = nullptr;
// call events for object target if present
if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET)
@@ -1524,8 +1524,8 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
{
Unit::AuraEffectList const& RejorRegr = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL);
// find most short by duration
AuraEffect* forcedTargetAura = NULL;
AuraEffect* targetAura = NULL;
AuraEffect* forcedTargetAura = nullptr;
AuraEffect* targetAura = nullptr;
for (Unit::AuraEffectList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
{
if ((*i)->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID
@@ -1668,7 +1668,7 @@ void Spell::DoCreateItem(uint8 /*effIndex*/, uint32 itemId)
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(newitemid);
if (!pProto)
{
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
return;
}
@@ -1750,7 +1750,7 @@ void Spell::DoCreateItem(uint8 /*effIndex*/, uint32 itemId)
else
{
// if not created by another reason from full inventory or unique items amount limitation
player->SendEquipError(msg, NULL, NULL, newitemid);
player->SendEquipError(msg, nullptr, nullptr, newitemid);
return;
}
}
@@ -1763,7 +1763,7 @@ void Spell::DoCreateItem(uint8 /*effIndex*/, uint32 itemId)
// was it successful? return error if not
if (!pItem)
{
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
return;
}
@@ -2243,9 +2243,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
// prevent crash at access and unexpected charges counting with item update queue corrupt
if (m_CastItem == m_targets.GetItemTarget())
m_targets.SetItemTarget(NULL);
m_targets.SetItemTarget(nullptr);
m_CastItem = NULL;
m_CastItem = nullptr;
m_castItemGUID = 0;
player->StoreItem(dest, pNewItem, true);
@@ -2263,9 +2263,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
// prevent crash at access and unexpected charges counting with item update queue corrupt
if (m_CastItem == m_targets.GetItemTarget())
m_targets.SetItemTarget(NULL);
m_targets.SetItemTarget(nullptr);
m_CastItem = NULL;
m_CastItem = nullptr;
m_castItemGUID = 0;
player->BankItem(dest, pNewItem, true);
@@ -2286,9 +2286,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
// prevent crash at access and unexpected charges counting with item update queue corrupt
if (m_CastItem == m_targets.GetItemTarget())
m_targets.SetItemTarget(NULL);
m_targets.SetItemTarget(nullptr);
m_CastItem = NULL;
m_CastItem = nullptr;
m_castItemGUID = 0;
player->EquipItem(dest, pNewItem, true);
@@ -2346,7 +2346,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
TempSummon* summon = NULL;
TempSummon* summon = nullptr;
// determine how many units should be summoned
uint32 numSummons;
@@ -2657,11 +2657,11 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->GetCategory() == SPELLCATEGORY_DEVOUR_MAGIC)
{
int32 heal_amount = m_spellInfo->Effects[EFFECT_1].CalcValue();
m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true);
m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, nullptr, nullptr, true);
// Glyph of Felhunter
if (Unit* owner = m_caster->GetOwner())
if (owner->GetAura(56249))
owner->CastCustomSpell(owner, 19658, &heal_amount, NULL, NULL, true);
owner->CastCustomSpell(owner, 19658, &heal_amount, nullptr, nullptr, true);
}
}
@@ -2799,7 +2799,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
// not scale value for item based reward (/10 value expected)
if (m_CastItem)
{
unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10, false);
unitTarget->ToPlayer()->RewardHonor(nullptr, 1, damage/10, false);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUIDLow());
#endif
@@ -2810,7 +2810,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
if (damage <= 50)
{
uint32 honor_reward = acore::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage));
unitTarget->ToPlayer()->RewardHonor(NULL, 1, honor_reward, false);
unitTarget->ToPlayer()->RewardHonor(nullptr, 1, honor_reward, false);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow());
#endif
@@ -2818,7 +2818,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
else
{
//maybe we have correct honor_gain in damage already
unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage, false);
unitTarget->ToPlayer()->RewardHonor(nullptr, 1, damage, false);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow());
#endif
@@ -2859,7 +2859,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
// and add a scroll
DoCreateItem(effIndex, m_spellInfo->Effects[effIndex].ItemType);
itemTarget=NULL;
m_targets.SetItemTarget(NULL);
m_targets.SetItemTarget(nullptr);
}
else
{
@@ -3757,7 +3757,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
else
{
delete linkedGO;
linkedGO = NULL;
linkedGO = nullptr;
return;
}
}
@@ -3789,7 +3789,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
uint32 spell_id = roll_chance_i(20) ? 8854 : 8855;
m_caster->CastSpell(m_caster, spell_id, true, NULL);
m_caster->CastSpell(m_caster, spell_id, true, nullptr);
return;
}
// Brittle Armor - need remove one 24575 Brittle Armor aura
@@ -3886,7 +3886,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
uint8 bag = 19;
uint8 slot = 0;
Item* item = NULL;
Item* item = nullptr;
while (bag) // 256 = 0 due to var type
{
@@ -3930,7 +3930,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
if (m_caster->getGender() > 0)
gender = "her";
sprintf(buf, "%s rubs %s [Decahedral Dwarven Dice] between %s hands and rolls. One %u and one %u.", m_caster->GetName().c_str(), gender, gender, urand(1, 10), urand(1, 10));
m_caster->MonsterTextEmote(buf, NULL);
m_caster->MonsterTextEmote(buf, nullptr);
break;
}
// Roll 'dem Bones - Worn Troll Dice
@@ -3941,7 +3941,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
if (m_caster->getGender() > 0)
gender = "her";
sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName().c_str(), gender, urand(1, 6), urand(1, 6));
m_caster->MonsterTextEmote(buf, NULL);
m_caster->MonsterTextEmote(buf, nullptr);
break;
}
// Death Knight Initiate Visual
@@ -4069,7 +4069,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
// proc a spellcast
if (Aura* chargesAura = m_caster->GetAura(59907))
{
m_caster->CastSpell(unitTarget, spell_heal, true, NULL, NULL, m_caster->ToTempSummon()->GetSummonerGUID());
m_caster->CastSpell(unitTarget, spell_heal, true, nullptr, nullptr, m_caster->ToTempSummon()->GetSummonerGUID());
if (chargesAura->ModCharges(-1))
m_caster->ToTempSummon()->UnSummon();
}
@@ -4098,14 +4098,14 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_SummonSlot[slot]);
if (totem && totem->IsTotem())
{
m_caster->CastCustomSpell(totem, 55277, &basepoints0, NULL, NULL, true);
m_caster->CastCustomSpell(totem, 55277, &basepoints0, nullptr, nullptr, true);
}
}
// Glyph of Stoneclaw Totem
if (AuraEffect* aur=unitTarget->GetAuraEffect(63298, 0))
{
basepoints0 *= aur->GetAmount();
m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, NULL, NULL, true);
m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, nullptr, nullptr, true);
}
break;
}
@@ -4610,7 +4610,7 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex)
player->DestroyItemCount(foodItem, count, true);
// TODO: fix crash when a spell has two effects, both pointed at the same item target
m_caster->CastCustomSpell(pet, m_spellInfo->Effects[effIndex].TriggerSpell, &benefit, NULL, NULL, true);
m_caster->CastCustomSpell(pet, m_spellInfo->Effects[effIndex].TriggerSpell, &benefit, nullptr, nullptr, true);
}
void Spell::EffectDismissPet(SpellEffIndex effIndex)
@@ -4961,7 +4961,7 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
// charge changes fall time
if( m_caster->GetTypeId() == TYPEID_PLAYER )
m_caster->ToPlayer()->SetFallInformation(time(NULL), m_caster->GetPositionZ());
m_caster->ToPlayer()->SetFallInformation(time(nullptr), m_caster->GetPositionZ());
if (m_pathFinder)
{
@@ -5082,7 +5082,7 @@ void Spell::EffectLeapBack(SpellEffIndex effIndex)
// xinef: changes fall time
if (m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->SetFallInformation(time(NULL), m_caster->GetPositionZ());
m_caster->ToPlayer()->SetFallInformation(time(nullptr), m_caster->GetPositionZ());
}
void Spell::EffectQuestClear(SpellEffIndex effIndex)
@@ -5268,7 +5268,7 @@ void Spell::EffectDestroyAllTotems(SpellEffIndex /*effIndex*/)
}
ApplyPct(mana, damage);
if (mana)
m_caster->CastCustomSpell(m_caster, 39104, &mana, NULL, NULL, true);
m_caster->CastCustomSpell(m_caster, 39104, &mana, nullptr, nullptr, true);
}
void Spell::EffectDurabilityDamage(SpellEffIndex effIndex)
@@ -5471,7 +5471,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
else
{
delete linkedGO;
linkedGO = NULL;
linkedGO = nullptr;
return;
}
}
@@ -5968,7 +5968,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
//TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
Map* map = caster->GetMap();
TempSummon* summon = NULL;
TempSummon* summon = nullptr;
for (uint32 count = 0; count < numGuardians; ++count)
{
@@ -6184,7 +6184,7 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/)
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item_id);
if (!pProto)
{
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
return;
}