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

@@ -91,7 +91,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
if (!creature->GetInstanceScript())
return NULL;
return nullptr;
hyjalAI* ai = new hyjalAI(creature);
@@ -176,7 +176,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
if (!creature->GetInstanceScript())
return NULL;
return nullptr;
hyjalAI* ai = new hyjalAI(creature);
@@ -204,7 +204,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
if (!creature->GetInstanceScript())
return NULL;
return nullptr;
hyjalAI* ai = new hyjalAI(creature);
ai->Reset();

View File

@@ -409,7 +409,7 @@ void hyjalAI::EnterEvadeMode()
if (me->IsAlive())
me->GetMotionMaster()->MoveTargetedHome();
me->SetLootRecipient(NULL);
me->SetLootRecipient(nullptr);
}
void hyjalAI::EnterCombat(Unit* /*who*/)
@@ -439,7 +439,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
{
SpawnLoc[i] = Base[random][i];
}
Creature* creature = NULL;
Creature* creature = nullptr;
switch (entry)
{
case 17906: //GARGOYLE
@@ -828,7 +828,7 @@ void hyjalAI::UpdateAI(uint32 diff)
if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
Unit* target = NULL;
Unit* target = nullptr;
switch (Spells[i].TargetType)
{
@@ -918,7 +918,7 @@ void hyjalAI::WaypointReached(uint32 waypointId)
{
if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL))
{
me->MonsterYell(YELL_HURRY, LANG_UNIVERSAL, NULL);
me->MonsterYell(YELL_HURRY, LANG_UNIVERSAL, nullptr);
WaitForTeleport = true;
TeleportTimer = 20000;
if (me->GetEntry() == JAINA)

View File

@@ -435,7 +435,7 @@ public:
SetEscortPaused(false);
SetRun(false);
Creature* cr = NULL;
Creature* cr = nullptr;
if ((cr = me->SummonCreature(NPC_CITY_MAN3, EventPos[EVENT_SRC_HALL_CITYMAN1])))
cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK);
if ((cr = me->SummonCreature(NPC_CITY_MAN4, EventPos[EVENT_SRC_HALL_CITYMAN2])))
@@ -1197,7 +1197,7 @@ Creature* npc_arthas::npc_arthasAI::GetEventNpc(uint32 entry)
++i;
}
return NULL;
return nullptr;
}
void npc_arthas::npc_arthasAI::ScheduleNextEvent(uint32 currentEvent, uint32 time)

View File

@@ -228,7 +228,7 @@ public:
void SummonPortalKeeper()
{
Creature* rift = NULL;
Creature* rift = nullptr;
for (std::set<uint64>::const_iterator itr = encounterNPCs.begin(); itr != encounterNPCs.end(); ++itr)
if (Creature* summon = instance->GetCreature(*itr))
if (summon->GetEntry() == NPC_TIME_RIFT)

View File

@@ -177,7 +177,7 @@ public:
//Charge_Timer
if (Charge_Timer <= diff)
{
Unit* target = NULL;
Unit* target = nullptr;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
{

View File

@@ -266,7 +266,7 @@ public:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
Creature* Spawned = NULL;
Creature* Spawned = nullptr;
//Spawn claw tentacle on the random target
Spawned = me->SummonCreature(NPC_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500);
@@ -529,7 +529,7 @@ public:
Unit* SelectRandomNotStomach()
{
if (Stomach_Map.empty())
return NULL;
return nullptr;
std::unordered_map<uint64, bool>::const_iterator i = Stomach_Map.begin();
@@ -550,7 +550,7 @@ public:
}
if (temp.empty())
return NULL;
return nullptr;
j = temp.begin();
@@ -749,7 +749,7 @@ public:
//Set target in stomach
Stomach_Map[target->GetGUID()] = true;
target->InterruptNonMeleeSpells(false);
target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, me->GetGUID());
target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, nullptr, nullptr, me->GetGUID());
StomachEnterTarget = target->GetGUID();
StomachEnterVisTimer = 3800;
}

View File

@@ -102,7 +102,7 @@ public:
//ChangeTarget_Timer
if (Submerged && ChangeTarget_Timer <= diff)
{
Unit* target = NULL;
Unit* target = nullptr;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)

View File

@@ -297,9 +297,9 @@ struct boss_twinemperorsAI : public ScriptedAI
me->GetCreatureListWithEntryInGrid(lUnitList, 15317, 150.0f);
if (lUnitList.empty())
return NULL;
return nullptr;
Creature* nearb = NULL;
Creature* nearb = nullptr;
for (std::list<Creature*>::const_iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter)
{
@@ -522,7 +522,7 @@ public:
//Blizzard_Timer
if (Blizzard_Timer <= diff)
{
Unit* target = NULL;
Unit* target = nullptr;
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true);
if (target)
DoCast(target, SPELL_BLIZZARD);
@@ -532,7 +532,7 @@ public:
if (ArcaneBurst_Timer <= diff)
{
Unit* mvic;
if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true)) != NULL)
if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true)) != nullptr)
{
DoCast(mvic, SPELL_ARCANEBURST);
ArcaneBurst_Timer = 5000;

View File

@@ -188,7 +188,7 @@ class npc_cork_gizelton : public CreatureScript
RemoveSummons();
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
Creature* cr = NULL;
Creature* cr = nullptr;
if ((cr = me->SummonCreature(NPC_RIGGER_GIZELTON, *me)))
{
cr->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
@@ -328,7 +328,7 @@ class npc_cork_gizelton : public CreatureScript
if (!_playerGUID)
return;
ImmuneFlagSet(true, _faction);
Creature* cr = NULL;
Creature* cr = nullptr;
for (uint8 i = 0; i < 4; ++i)
{
float o = (i*M_PI/2)+(M_PI/4);
@@ -353,7 +353,7 @@ class npc_cork_gizelton : public CreatureScript
if (!_playerGUID)
return;
ImmuneFlagSet(true, _faction);
Creature* cr = NULL;
Creature* cr = nullptr;
for (uint8 i = 0; i < 3; ++i)
{
float o = i*2*M_PI/3;

View File

@@ -638,7 +638,7 @@ public:
case 51:
{
uint32 entries[4] = { 15423, 15424, 15414, 15422 };
Unit* mob = NULL;
Unit* mob = nullptr;
for (uint8 i = 0; i < 4; ++i)
{
mob = player->FindNearestCreature(entries[i], 50, me);
@@ -806,7 +806,7 @@ public:
}
if (!hasTarget)
{
Unit* target = NULL;
Unit* target = nullptr;
if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
target = me->FindNearestCreature(15423, 20, true);
if (me->GetEntry() == 15423)
@@ -926,7 +926,7 @@ public:
if (Group* EventGroup = player->GetGroup())
{
Player* groupMember = NULL;
Player* groupMember = nullptr;
uint8 GroupMemberCount = 0;
uint8 DeadMemberCount = 0;

View File

@@ -82,7 +82,7 @@ public:
!player->HasItemCount(11522, 1, true))
{
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, NULL);
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, nullptr);
if (msg == EQUIP_ERR_OK)
player->StoreNewItem(dest, 11522, true);
}

View File

@@ -323,7 +323,7 @@ public:
// The array MUST be terminated by {0, 0, 0}
DialogueHelper(DialogueEntry const* dialogueArray) :
_dialogueArray(dialogueArray),
_currentEntry(NULL),
_currentEntry(nullptr),
_actionTimer(0)
{ }
// The array MUST be terminated by {0, 0, 0, 0, 0}
@@ -367,7 +367,7 @@ protected:
/// Will be called when a dialogue step was done
virtual void JustDidDialogueStep(int32 /*entry*/) { }
/// Will be called to get a speaker, MUST be implemented if not used in instances
virtual Creature* GetSpeakerByEntry(int32 /*entry*/) { return NULL; }
virtual Creature* GetSpeakerByEntry(int32 /*entry*/) { return nullptr; }
private:
void DoNextDialogueStep()
@@ -724,7 +724,7 @@ public:
case NPC_PRIESTESS_DATA_2:
return me->GetMap()->GetCreature(_secondPriestessGUID);
default:
return NULL;
return nullptr;
}
}