diff options
41 files changed, 157 insertions, 155 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 6d6acd08817..dc5710e1094 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -717,7 +717,7 @@ void SmartAI::OnCharmed(bool isNew) else me->SetWalk(!_run); - if (me->LastCharmerGUID) + if (!me->LastCharmerGUID.IsEmpty()) { if (!me->HasReactState(REACT_PASSIVE)) if (Unit* lastCharmer = ObjectAccessor::GetUnit(*me, me->LastCharmerGUID)) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index ac3c8cf4932..b41ba344b0c 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1420,7 +1420,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; if (e.GetTargetType() == SMART_TARGET_SELF) - me->SetFacingTo((me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && me->GetTransGUID() ? me->GetTransportHomePosition() : me->GetHomePosition()).GetOrientation()); + me->SetFacingTo((me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !me->GetTransGUID().IsEmpty() ? me->GetTransportHomePosition() : me->GetHomePosition()).GetOrientation()); else if (e.GetTargetType() == SMART_TARGET_POSITION) me->SetFacingTo(e.target.o); else if (!targets.empty()) @@ -3394,7 +3394,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST) { Unit* invoker = nullptr; - if (me && mTimedActionListInvoker) + if (me && !mTimedActionListInvoker.IsEmpty()) invoker = ObjectAccessor::GetUnit(*me, mTimedActionListInvoker); ProcessEvent(e, invoker); e.enableTimed = false;//disable event if it is in an ActionList and was processed once diff --git a/src/server/game/Chat/Channels/ChannelAppenders.h b/src/server/game/Chat/Channels/ChannelAppenders.h index d126b7861bf..b5d21198328 100644 --- a/src/server/game/Chat/Channels/ChannelAppenders.h +++ b/src/server/game/Chat/Channels/ChannelAppenders.h @@ -55,7 +55,7 @@ struct JoinedAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: @@ -70,7 +70,7 @@ struct LeftAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: @@ -139,7 +139,7 @@ struct PasswordChangedAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: @@ -154,7 +154,7 @@ struct OwnerChangedAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: @@ -213,7 +213,7 @@ struct ModeChangeAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; data << uint8(_oldFlags); data << uint8(_newFlags); } @@ -232,7 +232,7 @@ struct AnnouncementsOnAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: @@ -247,7 +247,7 @@ struct AnnouncementsOffAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: @@ -269,8 +269,8 @@ struct PlayerKickedAppend void Append(WorldPacket& data) const { - data << uint64(_kickee); - data << uint64(_kicker); + data << _kickee; + data << _kicker; } private: @@ -293,8 +293,8 @@ struct PlayerBannedAppend void Append(WorldPacket& data) const { - data << uint64(_banned); - data << uint64(_moderator); + data << _banned; + data << _moderator; } private: @@ -310,8 +310,8 @@ struct PlayerUnbannedAppend void Append(WorldPacket& data) const { - data << uint64(_unbanned); - data << uint64(_moderator); + data << _unbanned; + data << _moderator; } private: @@ -342,7 +342,7 @@ struct PlayerAlreadyMemberAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: @@ -357,7 +357,7 @@ struct InviteAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: @@ -451,7 +451,7 @@ struct VoiceOnAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: @@ -466,7 +466,7 @@ struct VoiceOffAppend void Append(WorldPacket& data) const { - data << uint64(_guid); + data << _guid; } private: diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 072f9c06ae0..1bd949b4da9 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -719,7 +719,7 @@ void LFGMgr::UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid /* = ObjectGuid:: // Sanitize input roles roles &= PLAYER_ROLE_ANY; - if (guid) + if (!guid.IsEmpty()) { if (Player* player = ObjectAccessor::FindPlayer(guid)) roles = FilterClassRoles(player, roles); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 3038e931aad..ba8ad1e613b 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1283,7 +1283,7 @@ void Creature::SetLootRecipient(Unit* unit, bool withGroup) m_lootRecipientGroup = group->GetLowGUID(); } else - m_lootRecipientGroup = ObjectGuid::Empty; + m_lootRecipientGroup = 0; SetDynamicFlag(UNIT_DYNFLAG_TAPPED); } @@ -3262,7 +3262,7 @@ void Creature::ReacquireSpellFocusTarget() if (!HasUnitFlag2(UNIT_FLAG2_CANNOT_TURN)) { - if (_spellFocusInfo.Target) + if (!_spellFocusInfo.Target.IsEmpty()) { if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, _spellFocusInfo.Target)) SetFacingToObject(objTarget, false); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index af8b65e7787..7de1e337139 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1019,7 +1019,7 @@ bool Item::IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) cons void Item::SendUpdateSockets() { WorldPacket data(SMSG_SOCKET_GEMS_RESULT, 8+4+4+4+4); - data << uint64(GetGUID()); + data << GetGUID(); for (uint32 i = SOCK_ENCHANTMENT_SLOT; i <= BONUS_ENCHANTMENT_SLOT; ++i) data << uint32(GetEnchantmentId(EnchantmentSlot(i))); @@ -1036,7 +1036,7 @@ void Item::SendTimeUpdate(Player* owner) return; WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8+4)); - data << uint64(GetGUID()); + data << GetGUID(); data << uint32(duration); owner->SendDirectMessage(&data); } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 2e62b1caa66..6b02a990fa1 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -234,7 +234,7 @@ void Object::DestroyForPlayer(Player* target, bool onDeath) const ASSERT(target); WorldPacket data(SMSG_DESTROY_OBJECT, 8 + 1); - data << uint64(GetGUID()); + data << GetGUID(); //! If the following bool is true, the client will call "void CGUnit_C::OnDeath()" for this object. //! OnDeath() does for eg trigger death animation and interrupts certain spells/missiles/auras/sounds... data << uint8(onDeath ? 1 : 0); @@ -1794,7 +1794,7 @@ void WorldObject::SendMessageToSet(WorldPacket const* data, Player const* skippe void WorldObject::SendObjectDeSpawnAnim(ObjectGuid guid) { WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8); - data << uint64(guid); + data << guid; SendMessageToSet(&data, true); } @@ -2164,7 +2164,8 @@ Player* WorldObject::SelectNearestPlayer(float distance) const ObjectGuid WorldObject::GetCharmerOrOwnerOrOwnGUID() const { - if (ObjectGuid guid = GetCharmerOrOwnerGUID()) + ObjectGuid guid = GetCharmerOrOwnerGUID(); + if (!guid.IsEmpty()) return guid; return GetGUID(); } @@ -2613,11 +2614,11 @@ void WorldObject::SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo miss { WorldPacket data(SMSG_SPELLLOGMISS, (4 + 8 + 1 + 4 + 8 + 1)); data << uint32(spellID); - data << uint64(GetGUID()); + data << GetGUID(); data << uint8(0); // can be 0 or 1 data << uint32(1); // target count // for (i = 0; i < target count; ++i) - data << uint64(target->GetGUID()); // target GUID + data << target->GetGUID(); // target GUID data << uint8(missInfo); // end loop SendMessageToSet(&data, true); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fa7d04c7638..8430845acd8 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6703,7 +6703,7 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto // victim_rank [0, 20+] HK: <> WorldPacket data(SMSG_PVP_CREDIT, 4+8+4); data << uint32(honor); - data << uint64(victim_guid); + data << victim_guid; data << uint32(victim_rank); SendDirectMessage(&data); @@ -8214,7 +8214,7 @@ void Player::RemovedInsignia(Player* looterPlr) void Player::SendLootRelease(ObjectGuid guid) const { WorldPacket data(SMSG_LOOT_RELEASE_RESPONSE, (8+1)); - data << uint64(guid) << uint8(1); + data << guid << uint8(1); SendDirectMessage(&data); } @@ -8595,7 +8595,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type) SetLootGUID(guid); WorldPacket data(SMSG_LOOT_RESPONSE, (9 + 50)); // we guess size - data << uint64(guid); + data << guid; data << uint8(loot_type); data << LootView(*loot, this, permission); SendDirectMessage(&data); @@ -8613,7 +8613,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type) void Player::SendLootError(ObjectGuid guid, LootError error) const { WorldPacket data(SMSG_LOOT_RESPONSE, 10); - data << uint64(guid); + data << guid; data << uint8(LOOT_NONE); data << uint8(error); SendDirectMessage(&data); @@ -11776,7 +11776,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update // save data std::ostringstream ss; GuidSet::const_iterator itr = allowedLooters.begin(); - ss << *itr; + ss << itr->GetCounter(); for (++itr; itr != allowedLooters.end(); ++itr) ss << ' ' << itr->GetCounter(); @@ -13260,7 +13260,7 @@ void Player::SendSellError(SellResult msg, Creature* creature, ObjectGuid guid, { WorldPacket data(SMSG_SELL_ITEM, (8+8+(4)+1)); // last check 2.0.10 data << (creature ? creature->GetGUID() : ObjectGuid::Empty); - data << uint64(guid); + data << guid; if (param > 0) data << uint32(param); data << uint8(msg); @@ -13990,7 +13990,7 @@ void Player::SendNewItem(Item* item, uint32 count, bool received, bool created, // last check 2.0.10 WorldPacket data(SMSG_ITEM_PUSH_RESULT, (8+4+4+4+1+4+4+4+4+4)); - data << uint64(GetGUID()); // player GUID + data << GetGUID(); // player GUID data << uint32(received); // 0=looted, 1=from npc data << uint32(created); // 0=received, 1=created data << uint32(sendChatMessage); // bool print message to chat @@ -16710,7 +16710,7 @@ void Player::SendQuestConfirmAccept(Quest const* quest, Player* pReceiver) const WorldPacket data(SMSG_QUEST_CONFIRM_ACCEPT, (4 + strTitle.size() + 8)); data << uint32(quest->GetQuestId()); data << strTitle; - data << uint64(GetGUID()); + data << GetGUID(); pReceiver->SendDirectMessage(&data); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT"); @@ -16722,7 +16722,7 @@ void Player::SendPushToPartyResponse(Player const* player, QuestShareMessages ms if (player) { WorldPacket data(MSG_QUEST_PUSH_RESULT, 8 + 1); - data << uint64(player->GetGUID()); + data << player->GetGUID(); data << uint8(msg); // valid values: 0-8 SendDirectMessage(&data); TC_LOG_DEBUG("network", "WORLD: Sent MSG_QUEST_PUSH_RESULT"); @@ -16753,7 +16753,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, ObjectGuid guid, data << uint32(entry); data << uint32(old_count + add_count); data << uint32(quest->RequiredNpcOrGoCount[ creatureOrGO_idx ]); - data << uint64(guid); + data << guid; SendDirectMessage(&data); uint16 log_slot = FindQuestSlot(quest->GetQuestId()); @@ -16800,7 +16800,7 @@ void Player::SendQuestGiverStatusMultiple() questStatus = GetQuestDialogStatus(questgiver); - data << uint64(questgiver->GetGUID()); + data << questgiver->GetGUID(); data << uint8(questStatus); ++count; } @@ -16812,7 +16812,7 @@ void Player::SendQuestGiverStatusMultiple() questStatus = GetQuestDialogStatus(questgiver); - data << uint64(questgiver->GetGUID()); + data << questgiver->GetGUID(); data << uint8(questStatus); ++count; } @@ -20759,7 +20759,7 @@ void Player::PetSpellInitialize() CharmInfo* charmInfo = pet->GetCharmInfo(); WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+1); - data << uint64(pet->GetGUID()); + data << pet->GetGUID(); data << uint16(pet->GetCreatureTemplate()->family); // creature family (required for pet talents) data << uint32(pet->GetDuration()); data << uint8(pet->GetReactState()); @@ -20813,7 +20813,7 @@ void Player::PossessSpellInitialize() } WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+1); - data << uint64(charm->GetGUID()); + data << charm->GetGUID(); data << uint16(0); data << uint32(0); data << uint32(0); @@ -20835,7 +20835,7 @@ void Player::VehicleSpellInitialize() uint8 cooldownCount = vehicle->GetSpellHistory()->GetCooldownsSizeForPacket(); WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * 10 + 1 + 1 + cooldownCount * (4 + 2 + 4 + 4)); - data << uint64(vehicle->GetGUID()); // Guid + data << vehicle->GetGUID(); // Guid data << uint16(0); // Pet Family (0 for all vehicles) data << uint32(vehicle->IsSummon() ? vehicle->ToTempSummon()->GetTimer() : 0); // Duration // The following three segments are read by the client as one uint32 @@ -20904,7 +20904,7 @@ void Player::CharmSpellInitialize() } WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+4*addlist+1); - data << uint64(charm->GetGUID()); + data << charm->GetGUID(); data << uint16(0); data << uint32(0); @@ -21533,7 +21533,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c uint32 new_count = pVendor->UpdateVendorItemCurrentCount(crItem, count); WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4)); - data << uint64(pVendor->GetGUID()); + data << pVendor->GetGUID(); data << uint32(vendorslot + 1); // numbered from 1 at client data << int32(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF); data << uint32(stacks); @@ -22717,7 +22717,7 @@ void Player::SendInitialPacketsAfterAddToMap() else if (GetRaidDifficulty() != GetStoredRaidDifficulty()) SendRaidDifficulty(GetGroup() != nullptr); - if (GetPlayerSharingQuest()) + if (!GetPlayerSharingQuest().IsEmpty()) { if (Quest const* quest = sObjectMgr->GetQuestTemplate(GetSharedQuestID())) PlayerTalkClass->SendQuestGiverQuestDetails(quest, GetGUID(), true); @@ -22823,7 +22823,7 @@ void Player::ApplyEquipCooldown(Item* pItem) GetSpellHistory()->AddCooldown(spellData.SpellId, pItem->GetEntry(), std::chrono::seconds(30)); WorldPacket data(SMSG_ITEM_COOLDOWN, 8 + 4); - data << uint64(pItem->GetGUID()); + data << pItem->GetGUID(); data << uint32(spellData.SpellId); SendDirectMessage(&data); } @@ -23487,7 +23487,7 @@ void Player::SendSummonRequestFrom(Unit* summoner) m_summon_location.WorldRelocate(*summoner); WorldPacket data(SMSG_SUMMON_REQUEST, 8 + 4 + 4); - data << uint64(summoner->GetGUID()); // summoner guid + data << summoner->GetGUID(); // summoner guid data << uint32(summoner->GetZoneId()); // summoner zone data << uint32(MAX_PLAYER_SUMMON_DELAY*IN_MILLISECONDS); // auto decline after msecs SendDirectMessage(&data); @@ -25640,9 +25640,9 @@ void Player::SendEquipmentSetList() { // ignored slots stored in IgnoreMask, client wants "1" as raw GUID, so no HighGuid::Item if (eqSet.second.Data.IgnoreMask & (1 << i)) - data.appendPackGUID(uint64(1)); + data << ObjectGuid(UI64LIT(1)).WriteAsPacked(); else - data.appendPackGUID(eqSet.second.Data.Pieces[i]); + data << eqSet.second.Data.Pieces[i].WriteAsPacked(); } ++count; // client have limit but it checked at loading and set @@ -26181,7 +26181,7 @@ void Player::SendRefundInfo(Item* item) } WorldPacket data(SMSG_ITEM_REFUND_INFO_RESPONSE, 8+4+4+4+4*4+4*4+4+4); - data << uint64(item->GetGUID()); // item guid + data << item->GetGUID(); // item guid data << uint32(item->GetPaidMoney()); // money cost data << uint32(iece->HonorPoints); // honor point cost data << uint32(iece->ArenaPoints); // arena point cost @@ -26229,7 +26229,7 @@ PetStable& Player::GetOrInitPetStable() void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) const { WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8 + 4 + 4 + 4 + 4 + 4 * 4 + 4 * 4); - data << uint64(item->GetGUID()); // item guid + data << item->GetGUID(); // item guid data << uint32(error); // 0, or error code if (!error) { diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index a7a5ef2840b..dc4f616afc1 100644 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -96,8 +96,8 @@ void PlayerSocial::RemoveFromSocialList(ObjectGuid const& friendGuid, SocialFlag CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_FLAGS); stmt->setUInt8(0, itr->second.Flags); - stmt->setUInt32(1, GetPlayerGUID()); - stmt->setUInt32(2, friendGuid); + stmt->setUInt32(1, GetPlayerGUID().GetCounter()); + stmt->setUInt32(2, friendGuid.GetCounter()); CharacterDatabase.Execute(stmt); } @@ -153,7 +153,7 @@ void PlayerSocial::SendSocialList(Player* player, uint32 flags) ++totalCount; SocialMgr::GetFriendInfo(player, v.first, v.second); - data << uint64(v.first); // player guid + data << v.first; // player guid data << uint32(contactFlags); // player flag (0x1 = Friend, 0x2 = Ignored, 0x4 = Muted) data << v.second.Note; // string note if (contactFlags & SOCIAL_FLAG_FRIEND) // if IsFriend() diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0b93a7e3c2a..0955dceda53 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -534,7 +534,7 @@ void Unit::UpdateSplineMovement(uint32 t_diff) WorldPacket data(SMSG_FLIGHT_SPLINE_SYNC, 4 + GetPackGUID().size()); Movement::PacketBuilder::WriteSplineSync(*movespline, data); - data.appendPackGUID(GetGUID()); + data << GetPackGUID(); SendMessageToSet(&data, true); } } @@ -1546,8 +1546,8 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) /// @todo Move this to a packet handler WorldPacket data(SMSG_SPELLDAMAGESHIELD, 8 + 8 + 4 + 4 + 4 + 4 + 4); - data << uint64(victim->GetGUID()); - data << uint64(GetGUID()); + data << victim->GetGUID(); + data << GetGUID(); data << uint32(spellInfo->Id); data << uint32(damage); // Damage int32 const overkill = int32(damage) - int32(GetHealth()); @@ -2132,7 +2132,8 @@ void Unit::AddExtraAttacks(uint32 count) ObjectGuid targetGUID = _lastDamagedTargetGuid; if (!targetGUID) { - if (ObjectGuid selection = GetTarget()) + ObjectGuid selection = GetTarget(); + if (!selection.IsEmpty()) targetGUID = selection; // Spell was cast directly (not triggered by aura) else return; @@ -5293,8 +5294,8 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo) void Unit::SendSpellDamageResist(Unit* target, uint32 spellId) { WorldPacket data(SMSG_PROCRESIST, 8+8+4+1); - data << uint64(GetGUID()); - data << uint64(target->GetGUID()); + data << GetGUID(); + data << target->GetGUID(); data << uint32(spellId); data << uint8(0); // bool - log format: 0-default, 1-debug SendMessageToSet(&data, true); @@ -5303,8 +5304,8 @@ void Unit::SendSpellDamageResist(Unit* target, uint32 spellId) void Unit::SendSpellDamageImmune(Unit* target, uint32 spellId) { WorldPacket data(SMSG_SPELLORDAMAGE_IMMUNE, 8+8+4+1); - data << uint64(GetGUID()); - data << uint64(target->GetGUID()); + data << GetGUID(); + data << target->GetGUID(); data << uint32(spellId); data << uint8(0); // bool - log format: 0-default, 1-debug SendMessageToSet(&data, true); @@ -10287,7 +10288,7 @@ void Unit::SendPetAIReaction(ObjectGuid guid) const return; WorldPacket data(SMSG_AI_REACTION, 8 + 4); - data << uint64(guid); + data << guid; data << uint32(AI_REACTION_HOSTILE); owner->ToPlayer()->SendDirectMessage(&data); } @@ -10987,8 +10988,8 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id) if (isRewardAllowed && player && player != victim) { WorldPacket data(SMSG_PARTYKILLLOG, (8+8)); // send event PARTY_KILL - data << uint64(player->GetGUID()); // player with killing blow - data << uint64(victim->GetGUID()); // victim + data << player->GetGUID(); // player with killing blow + data << victim->GetGUID(); // victim Player* looter = player; Group* group = player->GetGroup(); @@ -11019,7 +11020,7 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id) if (creature) { WorldPacket data2(SMSG_LOOT_LIST, 8 + 1 + 1); - data2 << uint64(creature->GetGUID()); + data2 << creature->GetGUID(); data2 << uint8(0); // unk1 data2 << uint8(0); // no group looter player->SendMessageToSet(&data2, true); @@ -12151,7 +12152,7 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update) (*itr)->SetPhaseMask(newPhaseMask, true); for (uint8 i = 0; i < MAX_SUMMON_SLOT; ++i) - if (m_SummonSlot[i]) + if (!m_SummonSlot[i].IsEmpty()) if (Creature* summon = GetMap()->GetCreature(m_SummonSlot[i])) summon->SetPhaseMask(newPhaseMask, true); @@ -13249,7 +13250,7 @@ void Unit::SetFacingTo(float ori, bool force) Movement::MoveSplineInit init(this); init.MoveTo(GetPositionX(), GetPositionY(), GetPositionZ(), false); - if (HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && GetTransGUID()) + if (HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !GetTransGUID().IsEmpty()) init.DisableTransportPathTransformations(); // It makes no sense to target global orientation init.SetFacing(ori); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 0ab9dd34b3a..895570999e9 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -498,7 +498,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData) // everything's fine, do it WorldPacket data(MSG_MINIMAP_PING, (8+4+4)); - data << uint64(GetPlayer()->GetGUID()); + data << GetPlayer()->GetGUID(); data << float(x); data << float(y); GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID()); @@ -697,7 +697,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recvData) // everything's fine, do it WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9); - data << uint64(GetPlayer()->GetGUID()); + data << GetPlayer()->GetGUID(); data << uint8(state); group->BroadcastReadyCheck(&data); } @@ -813,7 +813,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke if (pet) *data << pet->GetGUID(); else - *data << uint64(0); + *data << ObjectGuid::Empty; } if (mask & GROUP_UPDATE_FLAG_PET_NAME) @@ -993,7 +993,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData) data.put<uint64>(maskPos, auraMask); // GROUP_UPDATE_FLAG_AURAS if (updateFlags & GROUP_UPDATE_FLAG_PET_GUID) - data << uint64(ASSERT_NOTNULL(pet)->GetGUID()); + data << ASSERT_NOTNULL(pet)->GetGUID(); data << std::string(pet ? pet->GetName() : ""); // GROUP_UPDATE_FLAG_PET_NAME data << uint16(pet ? pet->GetDisplayId() : 0); // GROUP_UPDATE_FLAG_PET_MODEL_ID diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 17b02bb938a..aa7dc210317 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -615,7 +615,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid) if (!items) { WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + 1); - data << uint64(vendorGuid); + data << vendorGuid; data << uint8(0); // count == 0, next will be error code data << uint8(0); // "Vendor has no inventory" SendPacket(&data); @@ -626,7 +626,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid) uint8 count = 0; WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + itemCount * 8 * 4); - data << uint64(vendorGuid); + data << vendorGuid; size_t countPos = data.wpos(); data << uint8(count); @@ -785,10 +785,10 @@ void WorldSession::SendItemEnchantTimeUpdate(ObjectGuid Playerguid, ObjectGuid I { // last check 2.0.10 WorldPacket data(SMSG_ITEM_ENCHANT_TIME_UPDATE, (8+4+4+8)); - data << uint64(Itemguid); + data << Itemguid; data << uint32(slot); data << uint32(Duration); - data << uint64(Playerguid); + data << Playerguid; SendPacket(&data); } @@ -1204,7 +1204,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket& recvData ) if (Item* item = _player->GetItemByGuid(itemGuid)) { data << uint8(0); // has text - data << uint64(itemGuid); // item guid + data << itemGuid; // item guid data << item->GetText(); } else diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 50ffc294309..d6681060ade 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -971,7 +971,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recvData) return; WorldPacket data(MSG_INSPECT_HONOR_STATS, 8+1+4*4); - data << uint64(player->GetGUID()); + data << player->GetGUID(); data << uint8(player->GetHonorPoints()); data << uint32(player->GetUInt32Value(PLAYER_FIELD_KILLS)); data << uint32(player->GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION)); diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 8df75eb2e67..b816d638e3c 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -607,7 +607,7 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recvData) void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvData*/) { WorldPacket data(SMSG_MOUNTSPECIAL_ANIM, 8); - data << uint64(GetPlayer()->GetGUID()); + data << GetPlayer()->GetGUID(); GetPlayer()->SendMessageToSet(&data, false); } diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 510c849caa6..e5209b94e18 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -274,7 +274,7 @@ void WorldSession::SendBindPoint(Creature* npc) npc->CastSpell(_player, bindspell, true); WorldPacket data(SMSG_TRAINER_BUY_SUCCEEDED, (8+4)); - data << uint64(npc->GetGUID()); + data << npc->GetGUID(); data << uint32(bindspell); SendPacket(&data); @@ -308,7 +308,7 @@ void WorldSession::SendStablePet(ObjectGuid guid) WorldPacket data(MSG_LIST_STABLED_PETS, 200); // guess size - data << uint64(guid); + data << guid; size_t wpos = data.wpos(); data << uint8(0); // place holder for slot show number diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 30ffb79c31e..0785f7af5fd 100644 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -244,8 +244,8 @@ void WorldSession::SendPetitionSigns(Petition const* petition, Player* sendTo) { SignaturesVector const& signatures = petition->Signatures; WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8 + 8 + 4 + 1 + signatures.size() * 12)); - data << uint64(petition->PetitionGuid); // petition guid - data << uint64(petition->OwnerGuid); // owner guid + data << petition->PetitionGuid; // petition guid + data << petition->OwnerGuid; // owner guid data << uint32(petition->PetitionGuid.GetCounter()); // guild guid data << uint8(signatures.size()); // sign's count @@ -282,7 +282,7 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid) WorldPacket data(SMSG_PETITION_QUERY_RESPONSE, (4+8+petition->PetitionName.size()+1+1+4*12+2+10)); data << uint32(petitionguid.GetCounter()); // guild/team guid (in Trinity always same as GUID_LOPART(petition guid) - data << uint64(petition->OwnerGuid); // charter owner guid + data << petition->OwnerGuid; // charter owner guid data << petition->PetitionName; // name (guild/arena team) data << uint8(0); // some string @@ -374,8 +374,8 @@ void WorldSession::HandlePetitionRenameGuild(WorldPacket& recvData) petition->UpdateName(newName); TC_LOG_DEBUG("network", "Petition {} renamed to '{}'", petitionGuid.ToString(), newName); - WorldPacket data(MSG_PETITION_RENAME, (8+newName.size()+1)); - data << uint64(petitionGuid); + WorldPacket data(MSG_PETITION_RENAME, (8 + newName.size() + 1)); + data << petitionGuid; data << newName; SendPacket(&data); } @@ -461,8 +461,8 @@ void WorldSession::HandleSignPetition(WorldPacket& recvData) if (isSigned) { WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4)); - data << uint64(petitionGuid); - data << uint64(_player->GetGUID()); + data << petitionGuid; + data << _player->GetGUID(); data << uint32(PETITION_SIGN_ALREADY_SIGNED); // close at signer side @@ -480,8 +480,8 @@ void WorldSession::HandleSignPetition(WorldPacket& recvData) TC_LOG_DEBUG("network", "PETITION SIGN: {} by player: {} ({} Account: {})", petitionGuid.ToString(), _player->GetName(), playerGuid.ToString(), GetAccountId()); WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4)); - data << uint64(petitionGuid); - data << uint64(_player->GetGUID()); + data << petitionGuid; + data << _player->GetGUID(); data << uint32(PETITION_SIGN_OK); SendPacket(&data); @@ -506,7 +506,7 @@ void WorldSession::HandleDeclinePetition(WorldPacket& recvData) if (Player* owner = ObjectAccessor::FindConnectedPlayer(petition->OwnerGuid)) { WorldPacket data(MSG_PETITION_DECLINE, 8); - data << uint64(_player->GetGUID()); + data << _player->GetGUID(); owner->SendDirectMessage(&data); } } diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index ee694f7d366..c532bfc695b 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -614,7 +614,7 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData) return; WorldPacket data(SMSG_MIRRORIMAGE_DATA, 68); - data << uint64(guid); + data << guid; data << uint32(creator->GetDisplayId()); data << uint8(creator->GetRace()); data << uint8(creator->GetGender()); @@ -712,7 +712,7 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket) spell->RecalculateDelayMomentForDst(); WorldPacket data(SMSG_SET_PROJECTILE_POSITION, 21); - data << uint64(casterGuid); + data << casterGuid; data << uint8(castCount); data << float(x); data << float(y); diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 2a0f5ebaf4d..057a2491e8f 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -102,7 +102,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) WorldPacket data(SMSG_SHOWTAXINODES, (4 + 8 + 4 + 8 * 4)); data << uint32(1); - data << uint64(unit->GetGUID()); + data << unit->GetGUID(); data << uint32(curloc); GetPlayer()->m_taxi.AppendTaximaskTo(data, GetPlayer()->isTaxiCheater()); SendPacket(&data); @@ -138,7 +138,7 @@ bool WorldSession::SendLearnNewTaxiNode(Creature* unit) SendPacket(&msg); WorldPacket update(SMSG_TAXINODE_STATUS, 9); - update << uint64(unit->GetGUID()); + update << unit->GetGUID(); update << uint8(1); SendPacket(&update); diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 9b02adb6c86..b68e2f5f877 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -39,7 +39,7 @@ void WorldSession::SendTradeStatus(TradeStatusInfo const& info) switch (info.Status) { case TRADE_STATUS_BEGIN_TRADE: - data << uint64(info.TraderGuid); // CGTradeInfo::m_tradingPlayer + data << info.TraderGuid; // CGTradeInfo::m_tradingPlayer break; case TRADE_STATUS_OPEN_WINDOW: data << uint32(0); // CGTradeInfo::m_tradeID @@ -93,13 +93,13 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) data << uint32(item->GetCount()); // stack count // wrapped: hide stats but show giftcreator name data << uint32(item->IsWrapped() ? 1 : 0); - data << uint64(item->GetGuidValue(ITEM_FIELD_GIFTCREATOR)); + data << item->GetGuidValue(ITEM_FIELD_GIFTCREATOR); // perm. enchantment and gems data << uint32(item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot) data << uint32(item->GetEnchantmentId(EnchantmentSlot(enchant_slot))); // creator - data << uint64(item->GetGuidValue(ITEM_FIELD_CREATOR)); + data << item->GetGuidValue(ITEM_FIELD_CREATOR); data << uint32(item->GetSpellCharges()); // charges data << uint32(item->GetItemSuffixFactor()); // SuffixFactor data << uint32(item->GetItemRandomPropertyId());// random properties id diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 1435960d6e4..745e67c586c 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -638,7 +638,8 @@ void InstanceScript::DoRemoveAurasDueToSpellOnPlayer(Player* player, uint32 spel for (uint8 itr2 = 0; itr2 < MAX_SUMMON_SLOT; ++itr2) { - if (ObjectGuid summonGUID = player->m_SummonSlot[itr2]) + ObjectGuid summonGUID = player->m_SummonSlot[itr2]; + if (!summonGUID.IsEmpty()) if (Creature* summon = instance->GetCreature(summonGUID)) summon->RemoveAurasDueToSpell(spell); } @@ -673,7 +674,8 @@ void InstanceScript::DoCastSpellOnPlayer(Player* player, uint32 spell, bool incl for (uint8 itr2 = 0; itr2 < MAX_SUMMON_SLOT; ++itr2) { - if (ObjectGuid summonGUID = player->m_SummonSlot[itr2]) + ObjectGuid summonGUID = player->m_SummonSlot[itr2]; + if (!summonGUID.IsEmpty()) if (Creature* summon = instance->GetCreature(summonGUID)) summon->CastSpell(player, spell, true); } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 77e667bce06..bf4a8d1b197 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -840,7 +840,7 @@ void Map::Update(uint32 t_diff) // Totems for (ObjectGuid const& summonGuid : player->m_SummonSlot) - if (summonGuid) + if (!summonGuid.IsEmpty()) if (Creature* unit = GetCreature(summonGuid)) if (unit->GetMapId() == player->GetMapId() && !unit->IsWithinDistInMap(player, GetVisibilityRange(), false)) toVisit.push_back(unit); diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 0dd99243ea0..daa396335c3 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -104,7 +104,7 @@ bool RotateMovementGenerator::Update(Unit* owner, uint32 diff) Movement::MoveSplineInit init(owner); init.MoveTo(PositionToVector3(*owner), false); - if (owner->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && owner->GetTransGUID()) + if (owner->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !owner->GetTransGUID().IsEmpty()) init.DisableTransportPathTransformations(); init.SetFacing(angle); init.Launch(); @@ -159,7 +159,7 @@ void DistractMovementGenerator::Initialize(Unit* owner) Movement::MoveSplineInit init(owner); init.MoveTo(PositionToVector3(*owner), false); - if (owner->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && owner->GetTransGUID()) + if (owner->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !owner->GetTransGUID().IsEmpty()) init.DisableTransportPathTransformations(); init.SetFacing(_orientation); init.Launch(); diff --git a/src/server/game/Petitions/PetitionMgr.cpp b/src/server/game/Petitions/PetitionMgr.cpp index 978c6b3b36f..e7c73f4dad8 100644 --- a/src/server/game/Petitions/PetitionMgr.cpp +++ b/src/server/game/Petitions/PetitionMgr.cpp @@ -232,7 +232,7 @@ void Petition::AddSignature(uint32 accountId, ObjectGuid playerGuid, bool isLoad stmt->setUInt32(0, OwnerGuid.GetCounter()); stmt->setUInt32(1, PetitionGuid.GetCounter()); - stmt->setUInt32(2, playerGuid); + stmt->setUInt32(2, playerGuid.GetCounter()); stmt->setUInt32(3, accountId); CharacterDatabase.Execute(stmt); diff --git a/src/server/game/Server/Packets/SpellPackets.cpp b/src/server/game/Server/Packets/SpellPackets.cpp index 37d38d1da60..02818aaa721 100644 --- a/src/server/game/Server/Packets/SpellPackets.cpp +++ b/src/server/game/Server/Packets/SpellPackets.cpp @@ -70,7 +70,7 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellTargetData const& spellTargetData) ByteBuffer& operator<<(ByteBuffer& data, SpellMissStatus const& spellMissStatus) { - data << uint64(spellMissStatus.TargetGUID); + data << spellMissStatus.TargetGUID; data << uint8(spellMissStatus.Reason); if (spellMissStatus.Reason == SPELL_MISS_REFLECT) data << uint8(spellMissStatus.ReflectStatus); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 7d2ec0adfab..783e27a3a8b 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4711,7 +4711,7 @@ void Spell::SendResurrectRequest(Player* target) sentName = m_caster->GetNameForLocaleIdx(target->GetSession()->GetSessionDbLocaleIndex()); WorldPacket data(SMSG_RESURRECT_REQUEST, 8 + 4 + sentName.size() + 1 + 1 + 1); - data << uint64(m_caster->GetGUID()); + data << m_caster->GetGUID(); data << uint32(sentName.size() + 1); data << sentName; data << uint8(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsSpiritHealer()); // "you'll be afflicted with resurrection sickness" diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 182bb113b15..4b543169854 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -284,8 +284,8 @@ void Spell::EffectInstaKill() finish(); WorldPacket data(SMSG_SPELLINSTAKILLLOG, 8+8+4); - data << uint64(m_caster->GetGUID()); - data << uint64(unitTarget->GetGUID()); + data << m_caster->GetGUID(); + data << unitTarget->GetGUID(); data << uint32(m_spellInfo->Id); m_caster->SendMessageToSet(&data, true); @@ -2322,8 +2322,8 @@ void Spell::EffectDispel() if (!failCount) { // Failed to dispell - dataFail << uint64(m_caster->GetGUID()); // Caster GUID - dataFail << uint64(unitTarget->GetGUID()); // Victim GUID + dataFail << m_caster->GetGUID(); // Caster GUID + dataFail << unitTarget->GetGUID(); // Victim GUID dataFail << uint32(m_spellInfo->Id); // dispel spell id } ++failCount; @@ -3679,8 +3679,8 @@ void Spell::EffectDuel() // Send request WorldPacket data(SMSG_DUEL_REQUESTED, 8 + 8); - data << uint64(pGameObj->GetGUID()); - data << uint64(caster->GetGUID()); + data << pGameObj->GetGUID(); + data << caster->GetGUID(); caster->SendDirectMessage(&data); target->SendDirectMessage(&data); @@ -4173,7 +4173,7 @@ void Spell::EffectForceDeselect() // and selection data.Initialize(SMSG_CLEAR_TARGET, 8); - data << uint64(unitCaster->GetGUID()); + data << unitCaster->GetGUID(); Trinity::MessageDistDelivererToHostile notifierClear(unitCaster, &data, dist); Cell::VisitWorldObjects(unitCaster, notifierClear, dist); @@ -4976,8 +4976,8 @@ void Spell::EffectStealBeneficialBuff() if (!failCount) { // Failed to dispell - dataFail << uint64(m_caster->GetGUID()); // Caster GUID - dataFail << uint64(unitTarget->GetGUID()); // Victim GUID + dataFail << m_caster->GetGUID(); // Caster GUID + dataFail << unitTarget->GetGUID(); // Victim GUID dataFail << uint32(m_spellInfo->Id); // dispel spell id } ++failCount; diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index d39d4e069ec..81d99047ea3 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -374,7 +374,7 @@ void SpellHistory::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId / { WorldPacket data(SMSG_COOLDOWN_EVENT, 4 + 8); data << uint32(categoryItr->second->SpellId); - data << uint64(_owner->GetGUID()); + data << _owner->GetGUID(); player->SendDirectMessage(&data); if (startCooldown) @@ -383,7 +383,7 @@ void SpellHistory::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId / WorldPacket data(SMSG_COOLDOWN_EVENT, 4 + 8); data << uint32(spellInfo->Id); - data << uint64(_owner->GetGUID()); + data << _owner->GetGUID(); player->SendDirectMessage(&data); } @@ -423,7 +423,7 @@ void SpellHistory::ModifyCooldown(uint32 spellId, int32 cooldownModMs) { WorldPacket modifyCooldown(SMSG_MODIFY_COOLDOWN, 4 + 8 + 4); modifyCooldown << uint32(spellId); - modifyCooldown << uint64(_owner->GetGUID()); + modifyCooldown << _owner->GetGUID(); modifyCooldown << int32(cooldownModMs); playerOwner->SendDirectMessage(&modifyCooldown); } @@ -446,7 +446,7 @@ void SpellHistory::ResetCooldown(CooldownStorageType::iterator& itr, bool update { WorldPacket data(SMSG_CLEAR_COOLDOWN, 4 + 8); data << uint32(itr->first); - data << uint64(_owner->GetGUID()); + data << _owner->GetGUID(); playerOwner->SendDirectMessage(&data); } } @@ -611,7 +611,7 @@ void SpellHistory::SendClearCooldowns(std::vector<int32> const& cooldowns) const { WorldPacket data(SMSG_CLEAR_COOLDOWN, 4 + 8); data << uint32(spell); - data << uint64(_owner->GetGUID()); + data << _owner->GetGUID(); playerOwner->SendDirectMessage(&data); } } @@ -620,7 +620,7 @@ void SpellHistory::SendClearCooldowns(std::vector<int32> const& cooldowns) const void SpellHistory::BuildCooldownPacket(WorldPacket& data, uint8 flags, uint32 spellId, uint32 cooldown) const { data.Initialize(SMSG_SPELL_COOLDOWN, 8 + 1 + 4 + 4); - data << uint64(_owner->GetGUID()); + data << _owner->GetGUID(); data << uint8(flags); data << uint32(spellId); data << uint32(cooldown); @@ -629,7 +629,7 @@ void SpellHistory::BuildCooldownPacket(WorldPacket& data, uint8 flags, uint32 sp void SpellHistory::BuildCooldownPacket(WorldPacket& data, uint8 flags, PacketCooldowns const& cooldowns) const { data.Initialize(SMSG_SPELL_COOLDOWN, 8 + 1 + (4 + 4) * cooldowns.size()); - data << uint64(_owner->GetGUID()); + data << _owner->GetGUID(); data << uint8(flags); for (auto const& cooldown : cooldowns) { diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 12534c1547e..84b68176f21 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -397,7 +397,7 @@ void TicketMgr::ResolveAndCloseTicket(uint32 ticketId, ObjectGuid source) CharacterDatabaseTransaction trans = CharacterDatabaseTransaction(nullptr); ticket->SetClosedBy(source); ticket->SetResolvedBy(source); - if (source) + if (!source.IsEmpty()) --_openTicketCount; ticket->SaveToDB(trans); } diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 5d33e5d6e98..7c557055fd2 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -790,7 +790,7 @@ public: // Update level and reset XP, everything else will be updated at login CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL); stmt->setUInt8(0, static_cast<uint8>(newlevel)); - stmt->setUInt32(1, player->GetGUID()); + stmt->setUInt32(1, player->GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); } @@ -837,7 +837,7 @@ public: // Update level and reset XP, everything else will be updated at login CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL); stmt->setUInt8(0, static_cast<uint8>(newlevel)); - stmt->setUInt32(1, player->GetGUID()); + stmt->setUInt32(1, player->GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 99a5a524a2c..9b86dc7d576 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -1122,8 +1122,7 @@ public: { if (!pair.second) continue; - ObjectGuid guid = ObjectGuid::Create<HighGuid::Player>(pair.first); - Player const* player = ObjectAccessor::FindConnectedPlayer(guid); + Player const* player = ObjectAccessor::FindConnectedPlayer(pair.first); handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_SUBLABEL, player ? player->GetName() : Trinity::StringFormat("Offline player ({})", pair.first.ToString()), pair.second->size()); for (auto it = pair.second->cbegin(); it != pair.second->cend(); ++it) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp index dfc591f591d..df0eb7e6686 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp @@ -149,8 +149,8 @@ struct boss_vaelastrasz : public BossAI break; case EVENT_SPEECH_4: me->SetFaction(FACTION_DRAGONFLIGHT_BLACK); - if (PlayerGUID && ObjectAccessor::GetUnit(*me, PlayerGUID)) - AttackStart(ObjectAccessor::GetUnit(*me, PlayerGUID));; + if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) + AttackStart(player); break; } } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index f641abf1763..54341e97794 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -426,7 +426,7 @@ class npc_akilzon_eagle : public CreatureScript void MovementInform(uint32, uint32) override { arrived = true; - if (TargetGUID) + if (!TargetGUID.IsEmpty()) { if (Unit* target = ObjectAccessor::GetUnit(*me, TargetGUID)) DoCast(target, SPELL_EAGLE_SWOOP, true); diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index 7114c620d09..41497207d6e 100644 --- a/src/server/scripts/Kalimdor/zone_azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -148,7 +148,7 @@ public: void AttackStart(Unit* who) override { - if (!who || PlayerGUID) + if (!who || !PlayerGUID.IsEmpty()) return; Player* player = who->ToPlayer(); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 95d59c34b71..d02a9518e6d 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -554,7 +554,7 @@ struct npc_halion_controller : public ScriptedAI void JustAppeared() override { - if (_instance->GetGuidData(DATA_HALION) || _instance->GetBossState(DATA_GENERAL_ZARITHRIAN) != DONE) + if (!_instance->GetGuidData(DATA_HALION).IsEmpty() || _instance->GetBossState(DATA_GENERAL_ZARITHRIAN) != DONE) return; Reset(); @@ -625,7 +625,7 @@ struct npc_halion_controller : public ScriptedAI _events.ScheduleEvent(EVENT_START_INTRO, 2s); break; case ACTION_INTRO_HALION_2: - if (_instance->GetGuidData(DATA_HALION)) + if (!_instance->GetGuidData(DATA_HALION).IsEmpty()) return; for (uint8 i = DATA_BURNING_TREE_1; i <= DATA_BURNING_TREE_4; ++i) @@ -702,7 +702,7 @@ struct npc_halion_controller : public ScriptedAI break; case EVENT_INTRO_PROGRESS_3: DoCastSelf(SPELL_FIERY_EXPLOSION); - if (_instance->GetGuidData(DATA_HALION)) + if (!_instance->GetGuidData(DATA_HALION).IsEmpty()) return; if (Creature* halion = me->GetMap()->SummonCreature(NPC_HALION, HalionSpawnPos)) halion->AI()->Talk(SAY_INTRO); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index fff21635599..4dc78656d2a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -188,13 +188,12 @@ struct boss_anubrekhan : public BossAI case EVENT_SCARABS: if (!guardCorpses.empty()) { - if (ObjectGuid target = Trinity::Containers::SelectRandomContainerElement(guardCorpses)) - if (Creature* creatureTarget = ObjectAccessor::GetCreature(*me, target)) - { - creatureTarget->CastSpell(creatureTarget, SPELL_SUMMON_CORPSE_SCARABS_MOB, me->GetGUID()); - creatureTarget->AI()->Talk(EMOTE_SCARAB); - creatureTarget->DespawnOrUnsummon(); - } + if (Creature* creatureTarget = ObjectAccessor::GetCreature(*me, Trinity::Containers::SelectRandomContainerElement(guardCorpses))) + { + creatureTarget->CastSpell(creatureTarget, SPELL_SUMMON_CORPSE_SCARABS_MOB, me->GetGUID()); + creatureTarget->AI()->Talk(EMOTE_SCARAB); + creatureTarget->DespawnOrUnsummon(); + } } events.Repeat(randtime(Seconds(40), Seconds(60))); break; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index 9116e778146..bd16dacd912 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -529,7 +529,7 @@ class spell_sapphiron_icebolt : public AuraScript void HandleRemove(AuraEffect const* /*eff*/, AuraEffectHandleModes /*mode*/) { - if (_block) + if (!_block.IsEmpty()) if (GameObject* oBlock = ObjectAccessor::GetGameObject(*GetTarget(), _block)) oBlock->Delete(); GetTarget()->ApplySpellImmune(SPELL_ICEBOLT, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_FROST, false); @@ -537,7 +537,7 @@ class spell_sapphiron_icebolt : public AuraScript void HandlePeriodic(AuraEffect const* /*eff*/) { - if (_block) + if (!_block.IsEmpty()) return; if (GetTarget()->isMoving()) return; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index 8dd494f7855..3de86ec397b 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -648,7 +648,7 @@ private: Creature* myCoil() { Creature* coil = nullptr; - if (_myCoil) + if (!_myCoil.IsEmpty()) coil = ObjectAccessor::GetCreature(*me, _myCoil); if (!coil) { @@ -665,7 +665,7 @@ private: GameObject* myCoilGO() { GameObject* coil = nullptr; - if (_myCoilGO) + if (!_myCoilGO.IsEmpty()) coil = ObjectAccessor::GetGameObject(*me, _myCoilGO); if (!coil) { @@ -889,7 +889,7 @@ private: Creature* myCoil() { Creature* coil = nullptr; - if (_myCoil) + if (!_myCoil.IsEmpty()) coil = ObjectAccessor::GetCreature(*me, _myCoil); if (!coil) { @@ -906,7 +906,7 @@ private: GameObject* myCoilGO() { GameObject* coil = nullptr; - if (_myCoilGO) + if (!_myCoilGO.IsEmpty()) coil = ObjectAccessor::GetGameObject(*me, _myCoilGO); if (!coil) { diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 9bcc0f7733c..f3f65476cab 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -575,7 +575,7 @@ struct npc_wild_wyrm : public VehicleAI void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override { - if (_playerGuid || spellInfo->Id != SPELL_SPEAR_OF_HODIR) + if (!_playerGuid.IsEmpty() || spellInfo->Id != SPELL_SPEAR_OF_HODIR) return; _playerGuid = caster->GetGUID(); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 0d6b6dd2eca..d1940d4cdc6 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -136,7 +136,7 @@ struct boss_fathomlord_karathress : public BossAI // Respawn advisors for (uint8 i = 0; i < MAX_ADVISORS; ++i) - if (_advisors[i]) + if (!_advisors[i].IsEmpty()) { Creature* advisor = ObjectAccessor::GetCreature(*me, _advisors[i]); if (advisor && !advisor->IsAlive()) diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index 82a2d2616f2..f81d07193f5 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -696,7 +696,7 @@ struct npc_greyheart_spellbinder : public ScriptedAI { if (!me->IsInCombat() && !me->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) { - if (leotherasGUID) + if (!leotherasGUID.IsEmpty()) { Creature* leotheras = ObjectAccessor::GetCreature(*me, leotherasGUID); if (leotheras && leotheras->IsAlive()) @@ -710,7 +710,7 @@ struct npc_greyheart_spellbinder : public ScriptedAI if (!leotherasGUID) leotherasGUID = instance->GetGuidData(DATA_LEOTHERAS); - if (!me->IsInCombat() && instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER)) + if (!me->IsInCombat() && !instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER).IsEmpty()) { if (Unit* victim = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER))) AttackStart(victim); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index db48a98343e..e4dcf5ec4d5 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -692,7 +692,7 @@ class spell_hun_masters_call : public SpellScript // Do a mini Spell::CheckCasterAuras on the pet, no other way of doing this SpellCastResult result = SPELL_CAST_OK; uint32 const unitflag = pet->GetUnitFlags(); - if (pet->GetCharmerGUID()) + if (!pet->GetCharmerGUID().IsEmpty()) result = SPELL_FAILED_CHARMED; else if (unitflag & UNIT_FLAG_STUNNED) result = SPELL_FAILED_STUNNED; |