Skip to content

Commit 7eab6a7

Browse files
committed
Core/Entities: Final batch of removing implicit conversions of ObjectGuid to uint64
(cherry picked from commit 68f45e8)
1 parent 75f0369 commit 7eab6a7

File tree

41 files changed

+157
-155
lines changed

Some content is hidden

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

41 files changed

+157
-155
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ void SmartAI::OnCharmed(bool isNew)
717717
else
718718
me->SetWalk(!_run);
719719

720-
if (me->LastCharmerGUID)
720+
if (!me->LastCharmerGUID.IsEmpty())
721721
{
722722
if (!me->HasReactState(REACT_PASSIVE))
723723
if (Unit* lastCharmer = ObjectAccessor::GetUnit(*me, me->LastCharmerGUID))

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
14201420
break;
14211421

14221422
if (e.GetTargetType() == SMART_TARGET_SELF)
1423-
me->SetFacingTo((me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && me->GetTransGUID() ? me->GetTransportHomePosition() : me->GetHomePosition()).GetOrientation());
1423+
me->SetFacingTo((me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !me->GetTransGUID().IsEmpty() ? me->GetTransportHomePosition() : me->GetHomePosition()).GetOrientation());
14241424
else if (e.GetTargetType() == SMART_TARGET_POSITION)
14251425
me->SetFacingTo(e.target.o);
14261426
else if (!targets.empty())
@@ -3394,7 +3394,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
33943394
if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST)
33953395
{
33963396
Unit* invoker = nullptr;
3397-
if (me && mTimedActionListInvoker)
3397+
if (me && !mTimedActionListInvoker.IsEmpty())
33983398
invoker = ObjectAccessor::GetUnit(*me, mTimedActionListInvoker);
33993399
ProcessEvent(e, invoker);
34003400
e.enableTimed = false;//disable event if it is in an ActionList and was processed once

src/server/game/Chat/Channels/ChannelAppenders.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct JoinedAppend
5555

5656
void Append(WorldPacket& data) const
5757
{
58-
data << uint64(_guid);
58+
data << _guid;
5959
}
6060

6161
private:
@@ -70,7 +70,7 @@ struct LeftAppend
7070

7171
void Append(WorldPacket& data) const
7272
{
73-
data << uint64(_guid);
73+
data << _guid;
7474
}
7575

7676
private:
@@ -139,7 +139,7 @@ struct PasswordChangedAppend
139139

140140
void Append(WorldPacket& data) const
141141
{
142-
data << uint64(_guid);
142+
data << _guid;
143143
}
144144

145145
private:
@@ -154,7 +154,7 @@ struct OwnerChangedAppend
154154

155155
void Append(WorldPacket& data) const
156156
{
157-
data << uint64(_guid);
157+
data << _guid;
158158
}
159159

160160
private:
@@ -213,7 +213,7 @@ struct ModeChangeAppend
213213

214214
void Append(WorldPacket& data) const
215215
{
216-
data << uint64(_guid);
216+
data << _guid;
217217
data << uint8(_oldFlags);
218218
data << uint8(_newFlags);
219219
}
@@ -232,7 +232,7 @@ struct AnnouncementsOnAppend
232232

233233
void Append(WorldPacket& data) const
234234
{
235-
data << uint64(_guid);
235+
data << _guid;
236236
}
237237

238238
private:
@@ -247,7 +247,7 @@ struct AnnouncementsOffAppend
247247

248248
void Append(WorldPacket& data) const
249249
{
250-
data << uint64(_guid);
250+
data << _guid;
251251
}
252252

253253
private:
@@ -269,8 +269,8 @@ struct PlayerKickedAppend
269269

270270
void Append(WorldPacket& data) const
271271
{
272-
data << uint64(_kickee);
273-
data << uint64(_kicker);
272+
data << _kickee;
273+
data << _kicker;
274274
}
275275

276276
private:
@@ -293,8 +293,8 @@ struct PlayerBannedAppend
293293

294294
void Append(WorldPacket& data) const
295295
{
296-
data << uint64(_banned);
297-
data << uint64(_moderator);
296+
data << _banned;
297+
data << _moderator;
298298
}
299299

300300
private:
@@ -310,8 +310,8 @@ struct PlayerUnbannedAppend
310310

311311
void Append(WorldPacket& data) const
312312
{
313-
data << uint64(_unbanned);
314-
data << uint64(_moderator);
313+
data << _unbanned;
314+
data << _moderator;
315315
}
316316

317317
private:
@@ -342,7 +342,7 @@ struct PlayerAlreadyMemberAppend
342342

343343
void Append(WorldPacket& data) const
344344
{
345-
data << uint64(_guid);
345+
data << _guid;
346346
}
347347

348348
private:
@@ -357,7 +357,7 @@ struct InviteAppend
357357

358358
void Append(WorldPacket& data) const
359359
{
360-
data << uint64(_guid);
360+
data << _guid;
361361
}
362362

363363
private:
@@ -451,7 +451,7 @@ struct VoiceOnAppend
451451

452452
void Append(WorldPacket& data) const
453453
{
454-
data << uint64(_guid);
454+
data << _guid;
455455
}
456456

457457
private:
@@ -466,7 +466,7 @@ struct VoiceOffAppend
466466

467467
void Append(WorldPacket& data) const
468468
{
469-
data << uint64(_guid);
469+
data << _guid;
470470
}
471471

472472
private:

src/server/game/DungeonFinding/LFGMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ void LFGMgr::UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid /* = ObjectGuid::
719719
// Sanitize input roles
720720
roles &= PLAYER_ROLE_ANY;
721721

722-
if (guid)
722+
if (!guid.IsEmpty())
723723
{
724724
if (Player* player = ObjectAccessor::FindPlayer(guid))
725725
roles = FilterClassRoles(player, roles);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ void Creature::SetLootRecipient(Unit* unit, bool withGroup)
12831283
m_lootRecipientGroup = group->GetLowGUID();
12841284
}
12851285
else
1286-
m_lootRecipientGroup = ObjectGuid::Empty;
1286+
m_lootRecipientGroup = 0;
12871287

12881288
SetDynamicFlag(UNIT_DYNFLAG_TAPPED);
12891289
}
@@ -3262,7 +3262,7 @@ void Creature::ReacquireSpellFocusTarget()
32623262

32633263
if (!HasUnitFlag2(UNIT_FLAG2_CANNOT_TURN))
32643264
{
3265-
if (_spellFocusInfo.Target)
3265+
if (!_spellFocusInfo.Target.IsEmpty())
32663266
{
32673267
if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, _spellFocusInfo.Target))
32683268
SetFacingToObject(objTarget, false);

src/server/game/Entities/Item/Item.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ bool Item::IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) cons
10191019
void Item::SendUpdateSockets()
10201020
{
10211021
WorldPacket data(SMSG_SOCKET_GEMS_RESULT, 8+4+4+4+4);
1022-
data << uint64(GetGUID());
1022+
data << GetGUID();
10231023
for (uint32 i = SOCK_ENCHANTMENT_SLOT; i <= BONUS_ENCHANTMENT_SLOT; ++i)
10241024
data << uint32(GetEnchantmentId(EnchantmentSlot(i)));
10251025

@@ -1036,7 +1036,7 @@ void Item::SendTimeUpdate(Player* owner)
10361036
return;
10371037

10381038
WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8+4));
1039-
data << uint64(GetGUID());
1039+
data << GetGUID();
10401040
data << uint32(duration);
10411041
owner->SendDirectMessage(&data);
10421042
}

src/server/game/Entities/Object/Object.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void Object::DestroyForPlayer(Player* target, bool onDeath) const
234234
ASSERT(target);
235235

236236
WorldPacket data(SMSG_DESTROY_OBJECT, 8 + 1);
237-
data << uint64(GetGUID());
237+
data << GetGUID();
238238
//! If the following bool is true, the client will call "void CGUnit_C::OnDeath()" for this object.
239239
//! OnDeath() does for eg trigger death animation and interrupts certain spells/missiles/auras/sounds...
240240
data << uint8(onDeath ? 1 : 0);
@@ -1794,7 +1794,7 @@ void WorldObject::SendMessageToSet(WorldPacket const* data, Player const* skippe
17941794
void WorldObject::SendObjectDeSpawnAnim(ObjectGuid guid)
17951795
{
17961796
WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8);
1797-
data << uint64(guid);
1797+
data << guid;
17981798
SendMessageToSet(&data, true);
17991799
}
18001800

@@ -2164,7 +2164,8 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
21642164

21652165
ObjectGuid WorldObject::GetCharmerOrOwnerOrOwnGUID() const
21662166
{
2167-
if (ObjectGuid guid = GetCharmerOrOwnerGUID())
2167+
ObjectGuid guid = GetCharmerOrOwnerGUID();
2168+
if (!guid.IsEmpty())
21682169
return guid;
21692170
return GetGUID();
21702171
}
@@ -2613,11 +2614,11 @@ void WorldObject::SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo miss
26132614
{
26142615
WorldPacket data(SMSG_SPELLLOGMISS, (4 + 8 + 1 + 4 + 8 + 1));
26152616
data << uint32(spellID);
2616-
data << uint64(GetGUID());
2617+
data << GetGUID();
26172618
data << uint8(0); // can be 0 or 1
26182619
data << uint32(1); // target count
26192620
// for (i = 0; i < target count; ++i)
2620-
data << uint64(target->GetGUID()); // target GUID
2621+
data << target->GetGUID(); // target GUID
26212622
data << uint8(missInfo);
26222623
// end loop
26232624
SendMessageToSet(&data, true);

0 commit comments

Comments
 (0)