Skip to content

Commit 75f0369

Browse files
committed
Core/Entities: Second batch of removing implicit conversions of ObjectGuid to uint64
(cherry picked from commit 0345617)
1 parent d144724 commit 75f0369

File tree

44 files changed

+182
-137
lines changed

Some content is hidden

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

44 files changed

+182
-137
lines changed

src/server/game/Achievements/AchievementMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
702702
// broadcast realm first reached
703703
WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, GetPlayer()->GetName().size() + 1 + 8 + 4 + 4);
704704
data << GetPlayer()->GetName();
705-
data << uint64(GetPlayer()->GetGUID());
705+
data << GetPlayer()->GetGUID();
706706
data << uint32(achievement->ID);
707707

708708
std::size_t linkTypePos = data.wpos();

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
574574
{
575575
uint8 tmp = node-BG_AV_NODES_DUNBALDAR_SOUTH;
576576
//despawn marshal
577-
if (BgCreatures[AV_CPLACE_A_MARSHAL_SOUTH + tmp])
577+
if (!BgCreatures[AV_CPLACE_A_MARSHAL_SOUTH + tmp].IsEmpty())
578578
DelCreature(AV_CPLACE_A_MARSHAL_SOUTH + tmp);
579579
else
580580
TC_LOG_ERROR("bg.battleground", "BG_AV: playerdestroyedpoint: marshal {} doesn't exist", AV_CPLACE_A_MARSHAL_SOUTH + tmp);
@@ -632,10 +632,10 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
632632
TC_LOG_DEBUG("bg.battleground", "bg_av depopulating mine {} (0=north, 1=south)", mine);
633633
if (mine == AV_SOUTH_MINE)
634634
for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
635-
if (BgCreatures[i])
635+
if (!BgCreatures[i].IsEmpty())
636636
DelCreature(i); /// @todo just set the respawntime to 999999
637637
for (uint16 i=((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3); i++)
638-
if (BgCreatures[i])
638+
if (!BgCreatures[i].IsEmpty())
639639
DelCreature(i); /// @todo here also
640640
}
641641
SendMineWorldStates(mine);
@@ -732,7 +732,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
732732
else
733733
creatureid = (owner == ALLIANCE)? AV_NPC_A_GRAVEDEFENSE3 : AV_NPC_H_GRAVEDEFENSE3;
734734
//spiritguide
735-
if (BgCreatures[node])
735+
if (!BgCreatures[node].IsEmpty())
736736
DelCreature(node);
737737
if (!AddSpiritGuide(node, BG_AV_CreaturePos[node], GetTeamIndexByTeamId(owner)))
738738
TC_LOG_ERROR("bg.battleground", "AV: couldn't spawn spiritguide at node {}", node);
@@ -765,9 +765,9 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
765765
void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
766766
{
767767
uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + (4 * node);
768-
for (uint8 i=0; i<4; i++)
769-
if (BgCreatures[c_place+i])
770-
DelCreature(c_place+i);
768+
for (uint8 i = 0; i < 4; i++)
769+
if (!BgCreatures[c_place + i].IsEmpty())
770+
DelCreature(c_place + i);
771771
//spiritguide
772772
if (!IsTower(node) && !BgCreatures[node].IsEmpty())
773773
DelCreature(node);
@@ -1496,7 +1496,7 @@ void BattlegroundAV::ResetBGSubclass()
14961496

14971497
m_Mine_Timer = AV_MINE_TICK_TIMER;
14981498
for (uint16 i = 0; i < AV_CPLACE_MAX + AsUnderlyingType(AV_STATICCPLACE_MAX); i++)
1499-
if (BgCreatures[i])
1499+
if (!BgCreatures[i].IsEmpty())
15001500
DelCreature(i);
15011501
}
15021502

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point)
755755
else
756756
SendBroadcastText(m_CapturingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, player);
757757

758-
if (BgCreatures[Point])
758+
if (!BgCreatures[Point].IsEmpty())
759759
DelCreature(Point);
760760

761761
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveyardId);

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ void BattlegroundSA::UpdateDemolisherSpawns()
982982
{
983983
for (uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_8; i++)
984984
{
985-
if (BgCreatures[i])
985+
if (!BgCreatures[i].IsEmpty())
986986
{
987987
if (Creature* Demolisher = GetBGCreature(i))
988988
{
@@ -1013,10 +1013,10 @@ void BattlegroundSA::SendTransportInit(Player* player)
10131013
if (!BgObjects[BG_SA_BOAT_ONE].IsEmpty() || !BgObjects[BG_SA_BOAT_TWO].IsEmpty())
10141014
{
10151015
UpdateData transData;
1016-
if (BgObjects[BG_SA_BOAT_ONE])
1016+
if (!BgObjects[BG_SA_BOAT_ONE].IsEmpty())
10171017
GetBGObject(BG_SA_BOAT_ONE)->BuildCreateUpdateBlockForPlayer(&transData, player);
10181018

1019-
if (BgObjects[BG_SA_BOAT_TWO])
1019+
if (!BgObjects[BG_SA_BOAT_TWO].IsEmpty())
10201020
GetBGObject(BG_SA_BOAT_TWO)->BuildCreateUpdateBlockForPlayer(&transData, player);
10211021

10221022
WorldPacket packet;
@@ -1027,12 +1027,12 @@ void BattlegroundSA::SendTransportInit(Player* player)
10271027

10281028
void BattlegroundSA::SendTransportsRemove(Player* player)
10291029
{
1030-
if (BgObjects[BG_SA_BOAT_ONE] || BgObjects[BG_SA_BOAT_TWO])
1030+
if (!BgObjects[BG_SA_BOAT_ONE].IsEmpty() || !BgObjects[BG_SA_BOAT_TWO].IsEmpty())
10311031
{
10321032
UpdateData transData;
1033-
if (BgObjects[BG_SA_BOAT_ONE])
1033+
if (!BgObjects[BG_SA_BOAT_ONE].IsEmpty())
10341034
GetBGObject(BG_SA_BOAT_ONE)->BuildOutOfRangeUpdateBlock(&transData);
1035-
if (BgObjects[BG_SA_BOAT_TWO])
1035+
if (!BgObjects[BG_SA_BOAT_TWO].IsEmpty())
10361036
GetBGObject(BG_SA_BOAT_TWO)->BuildOutOfRangeUpdateBlock(&transData);
10371037
WorldPacket packet;
10381038
transData.BuildPacket(&packet);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,15 +776,15 @@ void Channel::Invite(Player const* player, std::string const& newname)
776776

777777
void Channel::SetOwner(ObjectGuid guid, bool exclaim)
778778
{
779-
if (_ownerGuid)
779+
if (!_ownerGuid.IsEmpty())
780780
{
781781
auto itr = _playersStore.find(_ownerGuid);
782782
if (itr != _playersStore.end())
783783
itr->second.SetOwner(false);
784784
}
785785

786786
_ownerGuid = guid;
787-
if (_ownerGuid)
787+
if (!_ownerGuid.IsEmpty())
788788
{
789789
uint8 oldFlag = GetPlayerFlags(_ownerGuid);
790790
auto itr = _playersStore.find(_ownerGuid);

src/server/game/Chat/Chat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, ObjectGuid guid, bool strong)
5555

5656
if (target)
5757
target_session = target->GetSession();
58-
else if (guid)
58+
else if (!guid.IsEmpty())
5959
target_account = sCharacterCache->GetCharacterAccountIdByGuid(guid);
6060

6161
if (!target_session && !target_account)

src/server/game/DungeonFinding/LFGMgr.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ void LFGMgr::Update(uint32 diff)
365365
{
366366
guid = itPlayers->first;
367367
SetState(guid, LFG_STATE_PROPOSAL);
368-
if (ObjectGuid gguid = GetGroup(guid))
368+
ObjectGuid gguid = GetGroup(guid);
369+
if (!gguid.IsEmpty())
369370
{
370371
SetState(gguid, LFG_STATE_PROPOSAL);
371372
SendLfgUpdateParty(guid, LfgUpdateData(LFG_UPDATETYPE_PROPOSAL_BEGIN, GetSelectedDungeons(guid), GetComment(guid)));
@@ -632,7 +633,7 @@ void LFGMgr::LeaveLfg(ObjectGuid guid, bool disconnected)
632633
switch (state)
633634
{
634635
case LFG_STATE_QUEUED:
635-
if (gguid)
636+
if (!gguid.IsEmpty())
636637
{
637638
LfgState newState = LFG_STATE_NONE;
638639
LfgState oldState = GetOldState(gguid);
@@ -662,7 +663,7 @@ void LFGMgr::LeaveLfg(ObjectGuid guid, bool disconnected)
662663
}
663664
break;
664665
case LFG_STATE_ROLECHECK:
665-
if (gguid)
666+
if (!gguid.IsEmpty())
666667
UpdateRoleCheck(gguid); // No player to update role = LFG_ROLECHECK_ABORTED
667668
break;
668669
case LFG_STATE_PROPOSAL:
@@ -1087,7 +1088,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, ObjectGuid guid, bool accept)
10871088
if (sendUpdate)
10881089
SendLfgUpdateProposal(pguid, proposal);
10891090

1090-
if (gguid)
1091+
if (!gguid.IsEmpty())
10911092
{
10921093
waitTime = int32((joinTime - queue.GetJoinTime(gguid)) / IN_MILLISECONDS);
10931094
SendLfgUpdateParty(pguid, updateData);
@@ -1375,7 +1376,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
13751376
error = LFG_TELEPORTERROR_FATIGUE;
13761377
else if (player->GetVehicle())
13771378
error = LFG_TELEPORTERROR_IN_VEHICLE;
1378-
else if (player->GetCharmedGUID())
1379+
else if (!player->GetCharmedGUID().IsEmpty())
13791380
error = LFG_TELEPORTERROR_CHARMING;
13801381
else if (player->HasAura(9454)) // check Freeze debuff
13811382
error = LFG_TELEPORTERROR_INVALID_LOCATION;

src/server/game/DungeonFinding/LFGScripts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void LFGGroupScript::OnInviteMember(Group* group, ObjectGuid guid)
241241
// No gguid == new group being formed
242242
// No leader == after group creation first invite is new leader
243243
// leader and no gguid == first invite after leader is added to new group (this is the real invite)
244-
if (leader && !gguid)
244+
if (!leader.IsEmpty() && gguid.IsEmpty())
245245
sLFGMgr->LeaveLfg(leader);
246246
}
247247

src/server/game/Entities/Creature/Creature.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ void Creature::RegenerateHealth()
942942
uint32 addvalue = 0;
943943

944944
// Not only pet, but any controlled creature (and not polymorphed)
945-
if (GetCharmerOrOwnerGUID() && !IsPolymorphed())
945+
if (!GetCharmerOrOwnerGUID().IsEmpty() && !IsPolymorphed())
946946
{
947947
float HealthIncreaseRate = sWorld->getRate(RATE_HEALTH);
948948
float Spirit = GetStat(STAT_SPIRIT);
@@ -2383,7 +2383,7 @@ bool Creature::CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction /
23832383
return false;
23842384

23852385
// only free creature
2386-
if (GetCharmerOrOwnerGUID())
2386+
if (!GetCharmerOrOwnerGUID().IsEmpty())
23872387
return false;
23882388

23892389
// only from same creature faction

src/server/game/Entities/GameObject/GameObject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ void GameObject::Use(Unit* user)
17131713
float x_i = GetPositionX() + relativeDistance * std::cos(orthogonalOrientation);
17141714
float y_i = GetPositionY() + relativeDistance * std::sin(orthogonalOrientation);
17151715

1716-
if (itr->second)
1716+
if (!itr->second.IsEmpty())
17171717
{
17181718
if (Player* ChairUser = ObjectAccessor::GetPlayer(*this, itr->second))
17191719
{
@@ -1937,7 +1937,7 @@ void GameObject::Use(Unit* user)
19371937
GameObjectTemplate const* info = GetGOInfo();
19381938

19391939
Player* m_ritualOwner = nullptr;
1940-
if (m_ritualOwnerGUID)
1940+
if (!m_ritualOwnerGUID.IsEmpty())
19411941
m_ritualOwner = ObjectAccessor::FindPlayer(m_ritualOwnerGUID);
19421942

19431943
// ritual owner is set for GO's without owner (not summoned)

0 commit comments

Comments
 (0)