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

@@ -123,7 +123,7 @@ Creature* SummonList::GetCreatureWithEntry(uint32 entry) const
return summon;
}
return NULL;
return nullptr;
}
ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature),
@@ -207,7 +207,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId)
void ScriptedAI::DoPlayMusic(uint32 soundId, bool zone)
{
ObjectList* targets = NULL;
ObjectList* targets = nullptr;
if (me && me->FindMap())
{
@@ -253,11 +253,11 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
{
//No target so we can't cast
if (!target)
return NULL;
return nullptr;
//Silenced so we can't cast
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
return NULL;
return nullptr;
//Using the extended script system we first create a list of viable spells
SpellInfo const* apSpell[CREATURE_MAX_SPELLS];
@@ -265,7 +265,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
uint32 spellCount = 0;
SpellInfo const* tempSpell = NULL;
SpellInfo const* tempSpell = nullptr;
//Check if each spell is viable(set it to null if not)
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; i++)
@@ -321,7 +321,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
//We got our usable spells so now lets randomly pick one
if (!spellCount)
return NULL;
return nullptr;
return apSpell[urand(0, spellCount - 1)];
}
@@ -377,7 +377,7 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
{
Unit* unit = NULL;
Unit* unit = nullptr;
acore::MostHPMissingInRange u_check(me, range, minHPDiff);
acore::UnitLastSearcher<acore::MostHPMissingInRange> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
@@ -405,7 +405,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 u
Player* ScriptedAI::GetPlayerAtMinimumRange(float minimumRange)
{
Player* player = NULL;
Player* player = nullptr;
CellCoord pair(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
@@ -456,9 +456,9 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea()
if (me->IsInEvadeMode() || !me->IsInCombat())
return false;
if (_evadeCheckCooldown == time(NULL))
if (_evadeCheckCooldown == time(nullptr))
return false;
_evadeCheckCooldown = time(NULL);
_evadeCheckCooldown = time(nullptr);
if (!CheckEvadeIfOutOfCombatArea())
return false;
@@ -484,7 +484,7 @@ Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura
if (!tList.empty())
return tList[urand(0,tList.size()-1)];
else
return NULL;
return nullptr;
}
// BossAI - for instanced bosses
@@ -492,7 +492,7 @@ Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura
BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature),
instance(creature->GetInstanceScript()),
summons(creature),
_boundary(instance ? instance->GetBossBoundary(bossId) : NULL),
_boundary(instance ? instance->GetBossBoundary(bossId) : nullptr),
_bossId(bossId)
{
}