diff options
| author | Shauren <shauren.trinity@gmail.com> | 2014-10-21 19:23:32 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2014-10-21 19:23:32 +0200 |
| commit | 9cc7044546eaaaf4fd7a999c5e074ad0ea3d47ef (patch) | |
| tree | e40c2f50a9b5b11620ee607103f0352521bdf54f /src/server/game/AI | |
| parent | 1bea52fd4649b6a1761aa157f9e74f01e19872e7 (diff) | |
Core/Entities: First batch of removing implicit conversions of ObjectGuid to uint64
Diffstat (limited to 'src/server/game/AI')
| -rw-r--r-- | src/server/game/AI/CoreAI/PetAI.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/AI/CoreAI/TotemAI.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.h | 4 |
5 files changed, 10 insertions, 8 deletions
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 327ad6ba8fa..41d32708baa 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -576,7 +576,8 @@ bool PetAI::CanAttack(Unit* target) void PetAI::ReceiveEmote(Player* player, uint32 emote) { - if (me->GetOwnerGUID() && me->GetOwnerGUID() == player->GetGUID()) + if (!me->GetOwnerGUID().IsEmpty() && me->GetOwnerGUID() == player->GetGUID()) + { switch (emote) { case TEXT_EMOTE_COWER: @@ -596,6 +597,7 @@ void PetAI::ReceiveEmote(Player* player, uint32 emote) me->HandleEmoteCommand(EMOTE_ONESHOT_OMNICAST_GHOUL); break; } + } } void PetAI::ClearCharmInfoFlags() diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index 6f456c0fd24..fb4d00b1f84 100644 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -66,7 +66,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/) // SPELLMOD_RANGE not applied in this place just because not existence range mods for attacking totems // pointer to appropriate target if found any - Unit* victim = i_victimGuid ? ObjectAccessor::GetUnit(*me, i_victimGuid) : NULL; + Unit* victim = !i_victimGuid.IsEmpty() ? ObjectAccessor::GetUnit(*me, i_victimGuid) : NULL; // Search victim if no, not attackable, or out of range, or friendly (possible in case duel end) if (!victim || diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index ef7f30ee087..1a733eefab0 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -278,7 +278,7 @@ void npc_escortAI::UpdateAI(uint32 diff) } //Check if player or any member of his group is within range - if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !me->GetVictim() && !HasEscortState(STATE_ESCORT_RETURNING)) + if (HasEscortState(STATE_ESCORT_ESCORTING) && !m_uiPlayerGUID.IsEmpty() && !me->GetVictim() && !HasEscortState(STATE_ESCORT_RETURNING)) { if (m_uiPlayerCheckTimer <= diff) { diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 92f02583915..037a82713e1 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -333,7 +333,7 @@ void SmartAI::UpdateAI(uint32 diff) UpdateDespawn(diff); /// @todo move to void - if (mFollowGuid) + if (!mFollowGuid.IsEmpty()) { if (mFollowArrivedTimer < diff) { @@ -435,7 +435,7 @@ void SmartAI::EnterEvadeMode() AddEscortState(SMART_ESCORT_RETURNING); ReturnToLastOOCPos(); } - else if (mFollowGuid) + else if (!mFollowGuid.IsEmpty()) { if (Unit* target = ObjectAccessor::GetUnit(*me, mFollowGuid)) me->GetMotionMaster()->MoveFollow(target, mFollowDist, mFollowAngle); @@ -674,7 +674,7 @@ void SmartAI::OnCharmed(bool apply) { GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply); - if (!apply && !me->IsInEvadeMode() && me->GetCharmerGUID()) + if (!apply && !me->IsInEvadeMode() && !me->GetCharmerGUID().IsEmpty()) if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetCharmerGUID())) AttackStart(charmer); } diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index b59b62c5697..02e91af032b 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -181,7 +181,7 @@ class SmartScript void OnReset(); void ResetBaseObject() { - if (meOrigGUID) + if (!meOrigGUID.IsEmpty()) { if (Creature* m = HashMapHolder<Creature>::Find(meOrigGUID)) { @@ -189,7 +189,7 @@ class SmartScript go = NULL; } } - if (goOrigGUID) + if (!goOrigGUID.IsEmpty()) { if (GameObject* o = HashMapHolder<GameObject>::Find(goOrigGUID)) { |
