mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 14:46:24 +00:00
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:
@@ -141,7 +141,7 @@ public:
|
||||
{
|
||||
if (param == ACTION_START_FIGHT)
|
||||
{
|
||||
Creature* cr = NULL;
|
||||
Creature* cr = nullptr;
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
@@ -285,7 +285,7 @@ public:
|
||||
if (Unit* coren = me->ToTempSummon()->GetSummoner())
|
||||
return coren->ToCreature();
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
@@ -436,7 +436,7 @@ public:
|
||||
{
|
||||
if (Aura* aur = player->GetAura(SPELL_RAM_AURA))
|
||||
{
|
||||
int32 diff = aur->GetApplyTime() - (time(NULL)-(HOUR*18)+spellCooldown);
|
||||
int32 diff = aur->GetApplyTime() - (time(nullptr)-(HOUR*18)+spellCooldown);
|
||||
if (diff > 10) // aura applied later
|
||||
return;
|
||||
|
||||
@@ -844,7 +844,7 @@ public:
|
||||
|
||||
bool AllowStart()
|
||||
{
|
||||
time_t curtime = time(NULL);
|
||||
time_t curtime = time(nullptr);
|
||||
tm strDate;
|
||||
ACE_OS::localtime_r(&curtime, &strDate);
|
||||
|
||||
@@ -1113,7 +1113,7 @@ public:
|
||||
if (timer >= 500)
|
||||
{
|
||||
timer = 0;
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
acore::AnyPlayerInObjectRangeCheck checker(me, 2.0f);
|
||||
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(me, player, checker);
|
||||
me->VisitNearbyWorldObject(2.0f, searcher);
|
||||
@@ -1471,7 +1471,7 @@ public:
|
||||
if (item && player->AddItem(item, 1)) // ensure filled keg is stored
|
||||
{
|
||||
player->DestroyItemCount(itemCaster->GetEntry(), 1, true);
|
||||
GetSpell()->m_CastItem = NULL;
|
||||
GetSpell()->m_CastItem = nullptr;
|
||||
GetSpell()->m_castItemGUID = 0;
|
||||
}
|
||||
}
|
||||
@@ -1538,7 +1538,7 @@ public:
|
||||
if (item && player->AddItem(item, 1)) // ensure filled keg is stored
|
||||
{
|
||||
player->DestroyItemCount(itemCaster->GetEntry(), 1, true);
|
||||
GetSpell()->m_CastItem = NULL;
|
||||
GetSpell()->m_CastItem = nullptr;
|
||||
GetSpell()->m_castItemGUID = 0;
|
||||
}
|
||||
}
|
||||
@@ -1584,7 +1584,7 @@ public:
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
WorldObject* target = NULL;
|
||||
WorldObject* target = nullptr;
|
||||
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
if (caster->HasInLine((*itr), 2.0f))
|
||||
{
|
||||
@@ -1613,7 +1613,7 @@ public:
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Creature* cr = NULL;
|
||||
Creature* cr = nullptr;
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
@@ -148,8 +148,8 @@ class spell_hallows_end_trick_or_treat : public SpellScriptLoader
|
||||
{
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
GetCaster()->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL);
|
||||
GetCaster()->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL);
|
||||
GetCaster()->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, nullptr);
|
||||
GetCaster()->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ class spell_hallows_end_candy : public SpellScriptLoader
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
uint32 spellId = SPELL_HALLOWS_END_CANDY_1+urand(0,3);
|
||||
GetCaster()->CastSpell(target, spellId, true, NULL);
|
||||
GetCaster()->CastSpell(target, spellId, true, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -709,7 +709,7 @@ class npc_hallows_end_soh : public CreatureScript
|
||||
tmpList.push_back(c);
|
||||
|
||||
if (tmpList.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
std::list<Unit*>::const_iterator it2 = tmpList.begin();
|
||||
std::advance(it2, urand(0, tmpList.size() - 1));
|
||||
@@ -989,7 +989,7 @@ class boss_headless_horseman : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
Player* GetRhymePlayer() { return playerGUID ? ObjectAccessor::GetPlayer(*me, playerGUID) : NULL; }
|
||||
Player* GetRhymePlayer() { return playerGUID ? ObjectAccessor::GetPlayer(*me, playerGUID) : nullptr; }
|
||||
|
||||
void EnterCombat(Unit*) { me->SetInCombatWithZone(); }
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
@@ -1229,7 +1229,7 @@ class boss_headless_horseman_head : public CreatureScript
|
||||
if (me->ToTempSummon())
|
||||
return me->ToTempSummon()->GetSummoner();
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
|
||||
@@ -462,7 +462,7 @@ class npc_love_in_air_hummel_helper : public CreatureScript
|
||||
{
|
||||
Position pos(*me);
|
||||
me->Relocate(target);
|
||||
me->CastSpell(me, RAND(SPELL_THROW_COLOGNE, SPELL_THROW_PERFUME), true, NULL, NULL, me->GetGUID());
|
||||
me->CastSpell(me, RAND(SPELL_THROW_COLOGNE, SPELL_THROW_PERFUME), true, nullptr, nullptr, me->GetGUID());
|
||||
me->Relocate(pos);
|
||||
}
|
||||
events.RepeatEvent(10000);
|
||||
@@ -553,7 +553,7 @@ class spell_love_in_air_periodic_perfumes : public SpellScriptLoader
|
||||
if (target->IsImmunedToSpell(sSpellMgr->GetSpellInfo(spellId)))
|
||||
return;
|
||||
|
||||
target->CastSpell(target, spellId, true, NULL, NULL, guid);
|
||||
target->CastSpell(target, spellId, true, nullptr, nullptr, guid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ public:
|
||||
}
|
||||
|
||||
// Achievement
|
||||
if ((time(NULL) - GetApplyTime()) > 60 && target->GetTypeId() == TYPEID_PLAYER)
|
||||
if ((time(nullptr) - GetApplyTime()) > 60 && target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58934, 0, target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class npc_pilgrims_bounty_chair : public CreatureScript
|
||||
uint32 timerSpawnPlate;
|
||||
uint32 timerRotateChair;
|
||||
|
||||
Creature* GetPlate() { return plateGUID ? ObjectAccessor::GetCreature(*me, plateGUID) : NULL; }
|
||||
Creature* GetPlate() { return plateGUID ? ObjectAccessor::GetCreature(*me, plateGUID) : nullptr; }
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
|
||||
@@ -139,7 +139,7 @@ class spell_winter_veil_racer_rocket_slam : public SpellScriptLoader
|
||||
PreventHitEffect(EFFECT_1);
|
||||
|
||||
std::list<Creature*> unitList;
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
caster->GetCreaturesWithEntryInRange(unitList, 30.0f, NPC_BLUE_RACER);
|
||||
if (!unitList.empty())
|
||||
for (std::list<Creature*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
|
||||
@@ -257,17 +257,17 @@ class spell_winter_veil_shoot_air_rifle : public SpellScriptLoader
|
||||
if (GetSpellInfo()->Id == SPELL_AIR_RIFLE_HIT_TRIGGER)
|
||||
{
|
||||
if (!caster->IsFriendlyTo(target))
|
||||
caster->CastSpell(target, SPELL_AIR_RIFLE_PELTED_DAMAGE, true, NULL, NULL, caster->GetGUID());
|
||||
caster->CastSpell(target, SPELL_AIR_RIFLE_PELTED_DAMAGE, true, nullptr, nullptr, caster->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8 rand = urand(0, 99);
|
||||
if (rand < 15)
|
||||
caster->CastSpell(caster, SPELL_AIR_RIFLE_RIGHT_IN_THE_EYE, true, NULL, NULL, caster->GetGUID());
|
||||
caster->CastSpell(caster, SPELL_AIR_RIFLE_RIGHT_IN_THE_EYE, true, nullptr, nullptr, caster->GetGUID());
|
||||
else if (rand < 35)
|
||||
caster->CastSpell(target, SPELL_AIR_RIFLE_STARLED, true, NULL, NULL, caster->GetGUID());
|
||||
caster->CastSpell(target, SPELL_AIR_RIFLE_STARLED, true, nullptr, nullptr, caster->GetGUID());
|
||||
else
|
||||
caster->CastSpell(target, SPELL_AIR_RIFLE_HIT, true, NULL, NULL, caster->GetGUID());
|
||||
caster->CastSpell(target, SPELL_AIR_RIFLE_HIT, true, nullptr, nullptr, caster->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user