aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/ScriptedAI
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-08-14 17:06:03 +0200
committerShauren <shauren.trinity@gmail.com>2020-08-14 17:06:03 +0200
commit1c52d5fff738aa01bd27fd117076ac33515acef5 (patch)
treeff7d2113e023a0fd47fbdde8ea94c0fe4bb9a804 /src/server/game/AI/ScriptedAI
parent02fd3a1f15840203d8515dae12920d9b66655076 (diff)
Core/Misc: Replace NULL with nullptr
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp10
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.h2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp12
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h2
4 files changed, 13 insertions, 13 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 8f06a5df423..c8ecf527f21 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -42,7 +42,7 @@ npc_escortAI::npc_escortAI(Creature* creature) : ScriptedAI(creature),
m_uiPlayerCheckTimer(1000),
m_uiEscortState(STATE_ESCORT_NONE),
MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
- m_pQuestForEscort(NULL),
+ m_pQuestForEscort(nullptr),
m_bIsActiveAttacker(true),
m_bIsRunning(false),
m_bCanInstantRespawn(false),
@@ -138,7 +138,7 @@ void npc_escortAI::JustDied(Unit* /*killer*/)
{
if (Group* group = player->GetGroup())
{
- for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
+ for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
if (Player* member = groupRef->GetSource())
if (member->IsInMap(player))
member->FailQuest(m_pQuestForEscort->GetQuestId());
@@ -176,7 +176,7 @@ void npc_escortAI::EnterEvadeMode(EvadeReason /*why*/)
me->RemoveAllAuras();
me->GetThreatManager().ClearAllThreat();
me->CombatStop(true);
- me->SetLootRecipient(NULL);
+ me->SetLootRecipient(nullptr);
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
@@ -199,7 +199,7 @@ bool npc_escortAI::IsPlayerOrGroupInRange()
{
if (Group* group = player->GetGroup())
{
- for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
+ for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
if (Player* member = groupRef->GetSource())
if (me->IsWithinDistInMap(member, GetMaxPlayerDistance()))
return true;
@@ -421,7 +421,7 @@ void npc_escortAI::SetRun(bool on)
}
/// @todo get rid of this many variables passed in function.
-void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, ObjectGuid playerGUID /* = 0 */, Quest const* quest /* = NULL */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
+void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, ObjectGuid playerGUID /* = 0 */, Quest const* quest /* = nullptr */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
{
if (me->GetVictim())
{
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
index 0bcec7e18ea..c72421ddc4b 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
@@ -90,7 +90,7 @@ struct TC_GAME_API npc_escortAI : public ScriptedAI
virtual void WaypointReached(uint32 pointId) = 0;
virtual void WaypointStart(uint32 /*pointId*/) { }
- void Start(bool isActiveAttacker = true, bool run = false, ObjectGuid playerGUID = ObjectGuid::Empty, Quest const* quest = NULL, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
+ void Start(bool isActiveAttacker = true, bool run = false, ObjectGuid playerGUID = ObjectGuid::Empty, Quest const* quest = nullptr, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
void SetRun(bool on = true);
void SetEscortPaused(bool on);
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 04cd868b1da..f048581fb69 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -41,7 +41,7 @@ enum Points
FollowerAI::FollowerAI(Creature* creature) : ScriptedAI(creature),
m_uiUpdateFollowTimer(2500),
m_uiFollowState(STATE_FOLLOW_NONE),
- m_pQuestForFollow(NULL)
+ m_pQuestForFollow(nullptr)
{ }
void FollowerAI::AttackStart(Unit* who)
@@ -134,7 +134,7 @@ void FollowerAI::JustDied(Unit* /*killer*/)
{
if (Group* group = player->GetGroup())
{
- for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
+ for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
if (Player* member = groupRef->GetSource())
if (member->IsInMap(player))
member->FailQuest(m_pQuestForFollow->GetQuestId());
@@ -162,7 +162,7 @@ void FollowerAI::EnterEvadeMode(EvadeReason /*why*/)
me->RemoveAllAuras();
me->GetThreatManager().ClearAllThreat();
me->CombatStop(true);
- me->SetLootRecipient(NULL);
+ me->SetLootRecipient(nullptr);
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
@@ -212,7 +212,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff)
if (Group* group = player->GetGroup())
{
- for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
+ for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
{
Player* member = groupRef->GetSource();
if (member && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE))
@@ -319,7 +319,7 @@ Player* FollowerAI::GetLeaderForFollower()
{
if (Group* group = player->GetGroup())
{
- for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
+ for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
{
Player* member = groupRef->GetSource();
if (member && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE) && member->IsAlive())
@@ -334,7 +334,7 @@ Player* FollowerAI::GetLeaderForFollower()
}
TC_LOG_DEBUG("scripts", "FollowerAI GetLeader can not find suitable leader.");
- return NULL;
+ return nullptr;
}
void FollowerAI::SetFollowComplete(bool bWithEndEvent)
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
index 0ea2361b17f..9999757b63c 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
@@ -57,7 +57,7 @@ class TC_GAME_API FollowerAI : public ScriptedAI
void UpdateAI(uint32) override; //the "internal" update, calls UpdateFollowerAI()
virtual void UpdateFollowerAI(uint32); //used when it's needed to add code in update (abilities, scripted events, etc)
- void StartFollow(Player* player, uint32 factionForFollower = 0, const Quest* quest = NULL);
+ void StartFollow(Player* player, uint32 factionForFollower = 0, const Quest* quest = nullptr);
void SetFollowPaused(bool bPaused); //if special event require follow mode to hold/resume during the follow
void SetFollowComplete(bool bWithEndEvent = false);