Skip to content

Commit d144724

Browse files
committed
Core/Entities: First batch of removing implicit conversions of ObjectGuid to uint64
(cherry picked from commit 9cc7044)
1 parent 3059fcd commit d144724

File tree

60 files changed

+158
-152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+158
-152
lines changed

src/server/game/AI/CoreAI/TotemAI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
5757
// SPELLMOD_RANGE not applied in this place just because not existence range mods for attacking totems
5858

5959
// pointer to appropriate target if found any
60-
Unit* victim = _victimGUID ? ObjectAccessor::GetUnit(*me, _victimGUID) : nullptr;
60+
Unit* victim = !_victimGUID.IsEmpty() ? ObjectAccessor::GetUnit(*me, _victimGUID) : nullptr;
6161

6262
// Search victim if no, not attackable, or out of range, or friendly (possible in case duel end)
6363
if (!victim || !victim->isTargetableForAttack() || !me->IsWithinDistInMap(victim, max_range) || me->IsFriendlyTo(victim) || !me->CanSeeOrDetect(victim))

src/server/game/AI/CreatureAI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= nullptr*/)
5353
// Disable CreatureAI when charmed
5454
void CreatureAI::OnCharmed(bool isNew)
5555
{
56-
if (isNew && !me->IsCharmed() && me->LastCharmerGUID)
56+
if (isNew && !me->IsCharmed() && !me->LastCharmerGUID.IsEmpty())
5757
{
5858
if (!me->HasReactState(REACT_PASSIVE))
5959
{

src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void EscortAI::UpdateAI(uint32 diff)
212212
}
213213

214214
// Check if player or any member of his group is within range
215-
if (_despawnAtFar && HasEscortState(STATE_ESCORT_ESCORTING) && _playerGUID && !me->IsEngaged() && !HasEscortState(STATE_ESCORT_RETURNING))
215+
if (_despawnAtFar && HasEscortState(STATE_ESCORT_ESCORTING) && !_playerGUID.IsEmpty() && !me->IsEngaged() && !HasEscortState(STATE_ESCORT_RETURNING))
216216
{
217217
if (_playerCheckTimer <= diff)
218218
{

src/server/game/AI/SmartScripts/SmartAI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ void SmartAI::EnterEvadeMode(EvadeReason /*why*/)
437437
AddEscortState(SMART_ESCORT_RETURNING);
438438
ReturnToLastOOCPos();
439439
}
440-
else if (Unit* target = _followGUID ? ObjectAccessor::GetUnit(*me, _followGUID) : nullptr)
440+
else if (Unit* target = !_followGUID.IsEmpty() ? ObjectAccessor::GetUnit(*me, _followGUID) : nullptr)
441441
{
442442
me->GetMotionMaster()->MoveFollow(target, _followDistance, _followAngle);
443443
// evade is not cleared in MoveFollow, so we can't keep it
@@ -988,7 +988,7 @@ void SmartAI::UpdatePath(uint32 diff)
988988

989989
void SmartAI::UpdateFollow(uint32 diff)
990990
{
991-
if (_followGUID)
991+
if (!_followGUID.IsEmpty())
992992
{
993993
if (_followArrivedTimer < diff)
994994
{

src/server/game/Battlefield/Battlefield.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ BfCapturePoint::~BfCapturePoint() = default;
863863

864864
bool BfCapturePoint::HandlePlayerEnter(Player* player)
865865
{
866-
if (m_capturePointGUID)
866+
if (!m_capturePointGUID.IsEmpty())
867867
{
868868
if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID))
869869
{
@@ -878,7 +878,7 @@ bool BfCapturePoint::HandlePlayerEnter(Player* player)
878878

879879
GuidSet::iterator BfCapturePoint::HandlePlayerLeave(Player* player)
880880
{
881-
if (m_capturePointGUID)
881+
if (!m_capturePointGUID.IsEmpty())
882882
if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID))
883883
player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldState1, 0);
884884

@@ -950,7 +950,7 @@ GameObject* BfCapturePoint::GetCapturePointGo()
950950

951951
bool BfCapturePoint::DelCapturePoint()
952952
{
953-
if (m_capturePointGUID)
953+
if (!m_capturePointGUID.IsEmpty())
954954
{
955955
if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID))
956956
{

src/server/game/Battlegrounds/ArenaTeam.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void ArenaTeam::Roster(WorldSession* session)
447447
{
448448
player = ObjectAccessor::FindConnectedPlayer(itr->Guid);
449449

450-
data << uint64(itr->Guid); // guid
450+
data << itr->Guid; // guid
451451
data << uint8((player ? 1 : 0)); // online flag
452452
data << itr->Name; // member name
453453
data << uint32((itr->Guid == GetCaptain() ? 0 : 1)); // captain flag 0 captain 1 member
@@ -513,7 +513,7 @@ void ArenaTeam::Inspect(WorldSession* session, ObjectGuid guid)
513513
return;
514514

515515
WorldPacket data(MSG_INSPECT_ARENA_TEAMS, 8+1+4*6);
516-
data << uint64(guid); // player guid
516+
data << guid; // player guid
517517
data << uint8(GetSlot()); // slot (0...2)
518518
data << uint32(GetId()); // arena team id
519519
data << uint32(Stats.Rating); // rating
@@ -576,8 +576,8 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, ObjectGuid guid, uint8 str
576576
return;
577577
}
578578

579-
if (guid)
580-
data << uint64(guid);
579+
if (!guid.IsEmpty())
580+
data << guid;
581581

582582
BroadcastPacket(&data);
583583

src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ void BattlegroundAB::Reset()
622622
}
623623

624624
for (uint8 i = 0; i < BG_AB_ALL_NODES_COUNT + 5; ++i)//+5 for aura triggers
625-
if (BgCreatures[i])
625+
if (!BgCreatures[i].IsEmpty())
626626
DelCreature(i);
627627
}
628628

src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
769769
if (BgCreatures[c_place+i])
770770
DelCreature(c_place+i);
771771
//spiritguide
772-
if (!IsTower(node) && BgCreatures[node])
772+
if (!IsTower(node) && !BgCreatures[node].IsEmpty())
773773
DelCreature(node);
774774

775775
//remove bonus honor aura trigger creature when node is lost

src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,13 +1010,15 @@ void BattlegroundSA::UpdateDemolisherSpawns()
10101010

10111011
void BattlegroundSA::SendTransportInit(Player* player)
10121012
{
1013-
if (BgObjects[BG_SA_BOAT_ONE] || BgObjects[BG_SA_BOAT_TWO])
1013+
if (!BgObjects[BG_SA_BOAT_ONE].IsEmpty() || !BgObjects[BG_SA_BOAT_TWO].IsEmpty())
10141014
{
10151015
UpdateData transData;
10161016
if (BgObjects[BG_SA_BOAT_ONE])
10171017
GetBGObject(BG_SA_BOAT_ONE)->BuildCreateUpdateBlockForPlayer(&transData, player);
1018+
10181019
if (BgObjects[BG_SA_BOAT_TWO])
10191020
GetBGObject(BG_SA_BOAT_TWO)->BuildCreateUpdateBlockForPlayer(&transData, player);
1021+
10201022
WorldPacket packet;
10211023
transData.BuildPacket(&packet);
10221024
player->SendDirectMessage(&packet);

src/server/game/Chat/Channels/Channel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ void Channel::List(Player const* player) const
627627
member->GetSession()->GetSecurity() <= AccountTypes(gmLevelInWhoList)) &&
628628
member->IsVisibleGloballyFor(player))
629629
{
630-
data << uint64(i->first);
630+
data << i->first;
631631
data << uint8(i->second.flags); // flags seems to be changed...
632632
++count;
633633
}
@@ -826,7 +826,7 @@ void Channel::JoinNotify(ObjectGuid guid) const
826826
LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale);
827827

828828
data.Initialize(IsConstant() ? SMSG_USERLIST_ADD : SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + 30 /*channelName buffer*/);
829-
data << uint64(guid);
829+
data << guid;
830830
data << uint8(GetPlayerFlags(guid));
831831
data << uint8(GetFlags());
832832
data << uint32(GetNumPlayers());
@@ -846,7 +846,7 @@ void Channel::LeaveNotify(ObjectGuid guid) const
846846
LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale);
847847

848848
data.Initialize(SMSG_USERLIST_REMOVE, 8 + 1 + 4 + 30 /*channelName buffer*/);
849-
data << uint64(guid);
849+
data << guid;
850850
data << uint8(GetFlags());
851851
data << uint32(GetNumPlayers());
852852
data << GetName(localeIdx);

0 commit comments

Comments
 (0)