mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 15: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:
@@ -445,7 +445,7 @@ class boss_illidan_stormrage : public CreatureScript
|
||||
events2.ScheduleEvent(EVENT_OUTRO_3, 17000);
|
||||
break;
|
||||
case EVENT_OUTRO_3:
|
||||
Unit::Kill(NULL, me);
|
||||
Unit::Kill(nullptr, me);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ class boss_supremus : public CreatureScript
|
||||
|
||||
Unit* FindHatefulStrikeTarget()
|
||||
{
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
|
||||
@@ -263,7 +263,7 @@ class spell_teron_gorefiend_spiritual_vengeance : public SpellScriptLoader
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit::Kill(NULL, GetTarget());
|
||||
Unit::Kill(nullptr, GetTarget());
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
Creature* member = NULL;
|
||||
Creature* member = nullptr;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if ((member = ObjectAccessor::GetCreature(*me, councilGUIDs[i])))
|
||||
member->AI()->EnterEvadeMode();
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
}
|
||||
else if (param == ACTION_ENRAGE)
|
||||
{
|
||||
Creature* member = NULL;
|
||||
Creature* member = nullptr;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if ((member = ObjectAccessor::GetCreature(*me, councilGUIDs[i])))
|
||||
member->AI()->DoAction(ACTION_ENRAGE);
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
else if (param == ACTION_END_ENCOUNTER)
|
||||
{
|
||||
me->setActive(false);
|
||||
Creature* member = NULL;
|
||||
Creature* member = nullptr;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if ((member = ObjectAccessor::GetCreature(*me, councilGUIDs[i])))
|
||||
if (member->IsAlive())
|
||||
@@ -657,7 +657,7 @@ class spell_illidari_council_reflective_shield : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
int32 bp = absorbAmount / 2;
|
||||
target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_T, &bp, NULL, NULL, true, NULL, aurEff);
|
||||
target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_T, &bp, nullptr, nullptr, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -476,7 +476,7 @@ class spell_lady_vashj_spore_drop_effect : public SpellScriptLoader
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SPELL_TOXIC_SPORES, true, NULL, NULL, GetCaster()->GetGUID());
|
||||
target->CastSpell(target, SPELL_TOXIC_SPORES, true, nullptr, nullptr, GetCaster()->GetGUID());
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -169,7 +169,7 @@ class boss_the_lurker_below : public CreatureScript
|
||||
if (me->getStandState() != UNIT_STAND_STATE_STAND || !me->isAttackReady() || me->GetReactState() != REACT_AGGRESSIVE)
|
||||
return;
|
||||
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
target = me->GetVictim();
|
||||
else
|
||||
|
||||
@@ -313,7 +313,7 @@ class spell_serpentshrine_cavern_infection : public SpellScriptLoader
|
||||
values.AddSpellMod(SPELLVALUE_MAX_TARGETS, 1);
|
||||
values.AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount()+500);
|
||||
values.AddSpellMod(SPELLVALUE_BASE_POINT1, aurEff->GetAmount()+500);
|
||||
GetTarget()->CastCustomSpell(SPELL_RAMPART_INFECTION, values, GetTarget(), TRIGGERED_FULL_MASK, NULL);
|
||||
GetTarget()->CastCustomSpell(SPELL_RAMPART_INFECTION, values, GetTarget(), TRIGGERED_FULL_MASK, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ public:
|
||||
if (target->GetPositionZ() < me->GetPositionZ()+6.0f)
|
||||
{
|
||||
int32 dmg = urand(5500,6000);
|
||||
me->CastCustomSpell(target, SPELL_COLD_SLAP, &dmg, NULL, NULL, false);
|
||||
me->CastCustomSpell(target, SPELL_COLD_SLAP, &dmg, nullptr, nullptr, false);
|
||||
float x, y, z;
|
||||
target->GetNearPoint(target, x, y, z, target->GetObjectSize(), 30.0f, target->GetAngle(me->GetPositionX(), me->GetPositionY()) + M_PI);
|
||||
target->GetMotionMaster()->MoveJump(x, y, z+20.0f, 10.0f, 20.0f);
|
||||
|
||||
@@ -168,7 +168,7 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
if (channeler && channeler->isDead())
|
||||
{
|
||||
channeler->DespawnOrUnsummon(1);
|
||||
channeler = NULL;
|
||||
channeler = nullptr;
|
||||
}
|
||||
if (!channeler)
|
||||
channeler = me->SummonCreature(NPC_CHANNELER, ShadowmoonChannelers[i][0], ShadowmoonChannelers[i][1], ShadowmoonChannelers[i][2], ShadowmoonChannelers[i][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
|
||||
@@ -293,7 +293,7 @@ class npc_shadowmoon_channeler : public CreatureScript
|
||||
{
|
||||
if (me->GetInstanceScript())
|
||||
return ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetData64(DATA_KELIDAN));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(_owner, _targetGUID))
|
||||
target->CastSpell(target, SPELL_DEBRIS_DAMAGE, true, NULL, NULL, _owner.GetGUID());
|
||||
target->CastSpell(target, SPELL_DEBRIS_DAMAGE, true, nullptr, nullptr, _owner.GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ class boss_magtheridon : public CreatureScript
|
||||
case EVENT_DEBRIS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
{
|
||||
target->CastSpell(target, SPELL_DEBRIS_VISUAL, true, NULL, NULL, me->GetGUID());
|
||||
target->CastSpell(target, SPELL_DEBRIS_VISUAL, true, nullptr, nullptr, me->GetGUID());
|
||||
me->m_Events.AddEvent(new DealDebrisDamage(*me, target->GetGUID()), me->m_Events.CalculateTime(5000));
|
||||
}
|
||||
events.ScheduleEvent(EVENT_DEBRIS, 20000);
|
||||
|
||||
@@ -106,7 +106,7 @@ class boss_warbringer_omrogg : public CreatureScript
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Creature* head = NULL;
|
||||
Creature* head = nullptr;
|
||||
uint32 eventId = EVENT_KILL_YELL_LEFT;
|
||||
if (urand(0, 1))
|
||||
{
|
||||
|
||||
@@ -726,7 +726,7 @@ class spell_kaelthas_kael_phase_two : public SpellScriptLoader
|
||||
if (GetCaster()->GetTypeId() == TYPEID_UNIT)
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
if (Creature* kael = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(NPC_KAELTHAS)))
|
||||
kael->AI()->SummonedCreatureDies(GetCaster()->ToCreature(), NULL);
|
||||
kael->AI()->SummonedCreatureDies(GetCaster()->ToCreature(), nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ class spell_capacitus_polarity_shift : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, true, NULL, NULL, GetCaster()->GetGUID());
|
||||
target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, true, nullptr, nullptr, GetCaster()->GetGUID());
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -81,7 +81,7 @@ class instance_mechanar : public InstanceMapScript
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->GetPositionX() < x && player->GetPositionZ() > 24.0f && player->GetPositionY() > -30.0f)
|
||||
return player;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DoSummonAction(Creature* summon, Player* player)
|
||||
|
||||
@@ -168,7 +168,7 @@ class npc_millhouse_manastorm : public CreatureScript
|
||||
break;
|
||||
case EVENT_SEARCH_FIGHT:
|
||||
if (!me->IsInCombat() && !me->IsInEvadeMode())
|
||||
if (Unit* target = me->SelectNearbyTarget(NULL, 30.0f))
|
||||
if (Unit* target = me->SelectNearbyTarget(nullptr, 30.0f))
|
||||
AttackStart(target);
|
||||
events2.ScheduleEvent(EVENT_SEARCH_FIGHT, 1000);
|
||||
break;
|
||||
|
||||
@@ -150,7 +150,7 @@ class spell_botanica_shift_form : public SpellScriptLoader
|
||||
{
|
||||
if (SpellInfo const* spellInfo = eventInfo.GetDamageInfo()->GetSpellInfo())
|
||||
{
|
||||
if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > time(NULL))
|
||||
if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > time(nullptr))
|
||||
return false;
|
||||
|
||||
uint32 form = 0;
|
||||
@@ -166,7 +166,7 @@ class spell_botanica_shift_form : public SpellScriptLoader
|
||||
|
||||
if (form)
|
||||
{
|
||||
_swapTime = time(NULL) + 6;
|
||||
_swapTime = time(nullptr) + 6;
|
||||
_lastSchool = spellInfo->GetSchoolMask();
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(_lastForm);
|
||||
_lastForm = form;
|
||||
|
||||
@@ -963,7 +963,7 @@ class npc_simon_bunny : public CreatureScript
|
||||
if (spell->Id == SPELL_BAD_PRESS_TRIGGER)
|
||||
{
|
||||
int32 bp = (int32)((float)(fails)*0.33f*target->GetMaxHealth());
|
||||
target->CastCustomSpell(target, SPELL_BAD_PRESS_DAMAGE, &bp, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, SPELL_BAD_PRESS_DAMAGE, &bp, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ryga = NULL;
|
||||
ryga = nullptr;
|
||||
me->CastSpell(me, SPELL_ANCESTRAL_WOLF_BUFF, false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
@@ -1168,7 +1168,7 @@ class npc_captain_saeed : public CreatureScript
|
||||
if (fight)
|
||||
SetEscortPaused(false);
|
||||
|
||||
SummonsAction(NULL);
|
||||
SummonsAction(nullptr);
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
@@ -1178,7 +1178,7 @@ class npc_captain_saeed : public CreatureScript
|
||||
for (std::list<uint64>::iterator itr = summons.begin(); itr != summons.end(); ++itr, i += 1.0f)
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
if (who == NULL)
|
||||
if (who == nullptr)
|
||||
{
|
||||
cr->GetMotionMaster()->Clear(false);
|
||||
cr->GetMotionMaster()->MoveFollow(me, 2.0f, M_PI/2.0f + (i / summons.size() * M_PI));
|
||||
@@ -1249,7 +1249,7 @@ class npc_captain_saeed : public CreatureScript
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_START_WALK:
|
||||
SummonsAction(NULL);
|
||||
SummonsAction(nullptr);
|
||||
SetEscortPaused(false);
|
||||
break;
|
||||
case EVENT_START_FIGHT1:
|
||||
|
||||
@@ -740,7 +740,7 @@ public:
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30658, 1, NULL);
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30658, 1, nullptr);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
player->StoreNewItem(dest, 30658, true);
|
||||
@@ -750,7 +750,7 @@ public:
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+2)
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, NULL);
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, nullptr);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
player->StoreNewItem(dest, 30659, true);
|
||||
@@ -1494,7 +1494,7 @@ void npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::SummonNextWave()
|
||||
|
||||
for (uint8 i = 0; i < count; ++i)
|
||||
{
|
||||
Creature* Spawn = NULL;
|
||||
Creature* Spawn = nullptr;
|
||||
float X = SpawnLocation[locIndex + i].x;
|
||||
float Y = SpawnLocation[locIndex + i].y;
|
||||
float Z = SpawnLocation[locIndex + i].z;
|
||||
@@ -1676,8 +1676,8 @@ public:
|
||||
}
|
||||
|
||||
// Spawn Soul on Kill ALWAYS!
|
||||
Creature* Summoned = NULL;
|
||||
Unit* totemOspirits = NULL;
|
||||
Creature* Summoned = nullptr;
|
||||
Unit* totemOspirits = nullptr;
|
||||
|
||||
if (entry != 0)
|
||||
Summoned = DoSpawnCreature(entry, 0, 0, 1, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
|
||||
|
||||
@@ -381,7 +381,7 @@ public:
|
||||
{
|
||||
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())
|
||||
{
|
||||
Player* groupie = itr->GetSource();
|
||||
if (groupie && groupie->IsInMap(player) &&
|
||||
|
||||
@@ -351,13 +351,13 @@ public:
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint32 itemId = 24573;
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1, NULL);
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1, nullptr);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
player->StoreNewItem(dest, itemId, true);
|
||||
}
|
||||
else
|
||||
player->SendEquipError(msg, NULL, NULL, itemId);
|
||||
player->SendEquipError(msg, nullptr, nullptr, itemId);
|
||||
}
|
||||
SendGossipMenuFor(player, 9231, creature->GetGUID());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user