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

@@ -407,7 +407,7 @@ public:
boss->CombatStop(true);
boss->LoadCreaturesAddon(true);
boss->GetMotionMaster()->MoveTargetedHome();
boss->SetLootRecipient(NULL);
boss->SetLootRecipient(nullptr);
}
boss->setFaction(FACTION_FRIEND);
}

View File

@@ -143,7 +143,7 @@ public:
switch (go->GetEntry())
{
case GO_WHELP_SPAWNER:
go->CastSpell(NULL, SPELL_SUMMON_ROOKERY_WHELP);
go->CastSpell(nullptr, SPELL_SUMMON_ROOKERY_WHELP);
break;
case GO_EMBERSEER_IN:
go_emberseerin = go->GetGUID();
@@ -443,8 +443,8 @@ public:
void Dragonspireroomcheck()
{
Creature* mob = NULL;
GameObject* rune = NULL;
Creature* mob = nullptr;
GameObject* rune = nullptr;
for (uint8 i = 0; i < 7; ++i)
{

View File

@@ -171,7 +171,7 @@ public:
break;
case EVENT_BURNINGADRENALINE_CASTER:
{
Unit* target = NULL;
Unit* target = nullptr;
uint8 i = 0;
while (i < 3) // max 3 tries to get a random target with power_mana

View File

@@ -81,7 +81,7 @@ class boss_curator : public CreatureScript
void JustSummoned(Creature* summon)
{
summons.Summon(summon);
if (Unit* target = summon->SelectNearbyTarget(NULL, 40.0f))
if (Unit* target = summon->SelectNearbyTarget(nullptr, 40.0f))
{
summon->AI()->AttackStart(target);
summon->AddThreat(target, 1000.0f);

View File

@@ -89,7 +89,7 @@ public:
struct netherspite_infernalAI : public ScriptedAI
{
netherspite_infernalAI(Creature* creature) : ScriptedAI(creature),
HellfireTimer(0), CleanupTimer(0), malchezaar(0), point(NULL) { }
HellfireTimer(0), CleanupTimer(0), malchezaar(0), point(nullptr) { }
uint32 HellfireTimer;
uint32 CleanupTimer;
@@ -365,7 +365,7 @@ public:
{
if (SWPainTimer <= diff)
{
Unit* target = NULL;
Unit* target = nullptr;
if (phase == 1)
target = me->GetVictim(); // Target the Tank
else // anyone but the tank
@@ -416,7 +416,7 @@ public:
{
if (AmplifyDamageTimer <= diff)
{
Unit* target = NULL;
Unit* target = nullptr;
target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (target)

View File

@@ -391,10 +391,10 @@ public:
{
ElementalsSpawned = true;
Creature* ElementalOne = NULL;
Creature* ElementalTwo = NULL;
Creature* ElementalThree = NULL;
Creature* ElementalFour = NULL;
Creature* ElementalOne = nullptr;
Creature* ElementalTwo = nullptr;
Creature* ElementalThree = nullptr;
Creature* ElementalFour = nullptr;
ElementalOne = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11168.1f, -1939.29f, 232.092f, 1.46f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
ElementalTwo = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11138.2f, -1915.38f, 232.092f, 3.00f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);

View File

@@ -171,9 +171,9 @@ public:
if (action == ACTION_TELEPORT_PLAYERS)
me->CastSpell(player, SPELL_GRAVITY_LAPSE_PLAYER+counter, true);
else if (action == ACTION_KNOCKUP)
player->CastSpell(player, SPELL_GRAVITY_LAPSE_DOT, true, NULL, NULL, me->GetGUID());
player->CastSpell(player, SPELL_GRAVITY_LAPSE_DOT, true, nullptr, nullptr, me->GetGUID());
else if (action == ACTION_ALLOW_FLY)
player->CastSpell(player, SPELL_GRAVITY_LAPSE_FLY, true, NULL, NULL, me->GetGUID());
player->CastSpell(player, SPELL_GRAVITY_LAPSE_FLY, true, nullptr, nullptr, me->GetGUID());
else if (action == ACTION_REMOVE_FLY)
{
player->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);

View File

@@ -206,7 +206,7 @@ public:
}
case EVENT_SPELL_DISPEL:
{
Unit* target = NULL;
Unit* target = nullptr;
switch (urand(0, 2))
{
case 0: target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true); break;
@@ -273,7 +273,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
const float dist_factor = (aiType == AI_TYPE_MELEE ? 15.0f : 25.0f);
float mod_dist = dist_factor/(dist_factor + dist); // 0.2 .. 1.0
float mod_health = health > 20000 ? 2.0f : (40000-health)/10000.0f; // 2.0 .. 4.0
float mod_armor = aiType == AI_TYPE_MELEE ? Unit::CalcArmorReducedDamage(me, target, 10000, NULL)/10000.0f : 1.0f;
float mod_armor = aiType == AI_TYPE_MELEE ? Unit::CalcArmorReducedDamage(me, target, 10000, nullptr)/10000.0f : 1.0f;
return mod_dist * mod_health * mod_armor;
}

View File

@@ -131,7 +131,7 @@ public:
return;
CrystalGUID = 0;
Unit* crystal = NULL;
Unit* crystal = nullptr;
for (SummonList::const_iterator i = summons.begin(); i != summons.end(); )
if (Creature* summon = ObjectAccessor::GetCreature(*me, *i++))
if (!crystal || me->GetDistanceOrder(summon, crystal, false))

View File

@@ -235,7 +235,7 @@ public:
{
me->DeleteThreatList();
me->CombatStop(false);
me->SetLootRecipient(NULL);
me->SetLootRecipient(nullptr);
if (HasEscortState(STATE_ESCORT_ESCORTING))
{

View File

@@ -582,7 +582,7 @@ public:
//If we are <75% hp cast healing spells at self or Mograine
if (Heal_Timer <= diff)
{
Creature* target = NULL;
Creature* target = nullptr;
if (!HealthAbovePct(75))
target = me;

View File

@@ -636,7 +636,7 @@ public:
orb->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
if (Creature* trigger = me->SummonTrigger(orb->GetPositionX(), orb->GetPositionY(), orb->GetPositionZ(), 0, 10*MINUTE*IN_MILLISECONDS))
{
trigger->CastSpell(trigger, SPELL_RING_OF_BLUE_FLAMES, true, NULL, NULL, trigger->GetGUID());
trigger->CastSpell(trigger, SPELL_RING_OF_BLUE_FLAMES, true, nullptr, nullptr, trigger->GetGUID());
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_KILJAEDEN_CONTROLLER)))
controller->AI()->JustSummoned(trigger);
}

View File

@@ -71,7 +71,7 @@ class instance_sunwell_plateau : public InstanceMapScript
//else
// TC_LOG_DEBUG("scripts", "Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!");
return NULL;
return nullptr;
}
void OnCreatureCreate(Creature* creature)

View File

@@ -72,8 +72,8 @@ class instance_uldaman : public InstanceMapScript
break;
case DATA_ARCHAEDAS:
_encounters[type] = data;
HandleGameObject(ancientVaultDoorGUID, data == DONE, NULL);
HandleGameObject(archaedasTempleDoorGUID, data != IN_PROGRESS, NULL);
HandleGameObject(ancientVaultDoorGUID, data == DONE, nullptr);
HandleGameObject(archaedasTempleDoorGUID, data != IN_PROGRESS, nullptr);
break;
}

View File

@@ -170,7 +170,7 @@ class boss_akilzon : public CreatureScript
if (Unit* target = (*i))
{
if (Cloud && !Cloud->IsWithinDist(target, 6, false))
Cloud->CastCustomSpell(target, SPELL_ZAP, &bp0, NULL, NULL, true, 0, 0, me->GetGUID());
Cloud->CastCustomSpell(target, SPELL_ZAP, &bp0, nullptr, nullptr, true, 0, 0, me->GetGUID());
}
}
@@ -188,7 +188,7 @@ class boss_akilzon : public CreatureScript
trigger->SetHealth(100000);
trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (Cloud)
Cloud->CastCustomSpell(trigger, /*43661*/SPELL_ZAP, &bp0, NULL, NULL, true, 0, 0, Cloud->GetGUID());
Cloud->CastCustomSpell(trigger, /*43661*/SPELL_ZAP, &bp0, nullptr, nullptr, true, 0, 0, Cloud->GetGUID());
}
}
}

View File

@@ -453,7 +453,7 @@ class boss_hexlord_malacrass : public CreatureScript
void UseAbility()
{
uint8 random = urand(0, 2);
Unit* target = NULL;
Unit* target = nullptr;
switch (PlayerAbility[PlayerClass][random].target)
{
case ABILITY_TARGET_SELF:

View File

@@ -184,7 +184,7 @@ class boss_janalai : public CreatureScript
void FireWall()
{
uint8 WallNum;
Creature* wall = NULL;
Creature* wall = nullptr;
for (uint8 i = 0; i < 4; ++i)
{
if (i == 0 || i == 2)

View File

@@ -252,7 +252,7 @@ class boss_zuljin : public CreatureScript
void SpawnAdds()
{
Creature* creature = NULL;
Creature* creature = nullptr;
for (uint8 i = 0; i < 4; ++i)
{
creature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0);

View File

@@ -99,7 +99,7 @@ class boss_marli : public CreatureScript
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
Talk(SAY_SPIDER_SPAWN);
Creature* Spider = NULL;
Creature* Spider = nullptr;
Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(target);
@@ -158,7 +158,7 @@ class boss_marli : public CreatureScript
}
case EVENT_CHARGE_PLAYER:
{
Unit* target = NULL;
Unit* target = nullptr;
int i = 0;
while (i++ < 3) // max 3 tries to get a random target with power_mana
{

View File

@@ -89,7 +89,7 @@ class boss_renataki : public CreatureScript
{
if (Ambush_Timer <= diff)
{
Unit* target = NULL;
Unit* target = nullptr;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
{
@@ -123,7 +123,7 @@ class boss_renataki : public CreatureScript
{
if (Aggro_Timer <= diff)
{
Unit* target = NULL;
Unit* target = nullptr;
target = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (DoGetThreat(me->GetVictim()))

View File

@@ -48,7 +48,7 @@ class spell_razelikh_teleport_group : public SpellScriptLoader
{
if (Group* group = player->GetGroup())
{
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
if (Player* member = itr->GetSource())
if (member->IsWithinDistInMap(player, 20.0f) && !member->isDead())
member->CastSpell(member, SPELL_TELEPORT_SINGLE_IN_GROUP, true);

View File

@@ -287,7 +287,7 @@ public:
timer += diff;
if (timer >= 4000)
{
Unit* target = _targetGUID ? ObjectAccessor::GetUnit(*me, _targetGUID) : NULL;
Unit* target = _targetGUID ? ObjectAccessor::GetUnit(*me, _targetGUID) : nullptr;
if (!target)
target = me->FindNearestCreature(NPC_INJURED_PEASANT, 60.0f);

View File

@@ -220,7 +220,7 @@ public:
{
if (Creature* summoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000))
{
Unit* target = NULL;
Unit* target = nullptr;
if (PlayerGUID)
if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID))
if (player->IsAlive() && RAND(0, 1))

View File

@@ -64,7 +64,7 @@ public:
{
case 0:
{
GameObject* cage = NULL;
GameObject* cage = nullptr;
if (galensCageGUID)
cage = me->GetMap()->GetGameObject(galensCageGUID);
else

View File

@@ -1010,7 +1010,7 @@ public:
{
me->DeleteThreatList();
me->CombatStop(true);
me->SetLootRecipient(NULL);
me->SetLootRecipient(nullptr);
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
@@ -2356,7 +2356,7 @@ public:
me->RemoveAura(SPELL_HEROIC_VANGUARD);
me->DeleteThreatList();
me->CombatStop(true);
me->SetLootRecipient(NULL);
me->SetLootRecipient(nullptr);
if (HasEscortState(STATE_ESCORT_ESCORTING))
{