refactor(Core): Make ObjectGuid const (#23170)
* cherry-pick commit (https://github.com/TrinityCore/TrinityCore/commit/a7883380ce4c827db103b0c43faca6632c3d1f66) Co-Authored-By: Lucas Nascimento <keader.android@gmail.com>
This commit is contained in:
@@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
// Pass parameters between AI
|
// Pass parameters between AI
|
||||||
virtual void DoAction(int32 /*param = 0 */) {}
|
virtual void DoAction(int32 /*param = 0 */) {}
|
||||||
virtual void SetGUID(ObjectGuid /*guid*/, int32 /*id = 0 */) {}
|
virtual void SetGUID(ObjectGuid const& /*guid*/, int32 /*id = 0 */) {}
|
||||||
virtual ObjectGuid GetGUID(int32 /*id = 0 */) const { return ObjectGuid::Empty; }
|
virtual ObjectGuid GetGUID(int32 /*id = 0 */) const { return ObjectGuid::Empty; }
|
||||||
|
|
||||||
static int32 Permissible(GameObject const* go);
|
static int32 Permissible(GameObject const* go);
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ public:
|
|||||||
virtual void DoAction(int32 /*param*/) {}
|
virtual void DoAction(int32 /*param*/) {}
|
||||||
virtual uint32 GetData(uint32 /*id = 0*/) const { return 0; }
|
virtual uint32 GetData(uint32 /*id = 0*/) const { return 0; }
|
||||||
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
|
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
|
||||||
virtual void SetGUID(ObjectGuid /*guid*/, int32 /*id*/ = 0) {}
|
virtual void SetGUID(ObjectGuid const& /*guid*/, int32 /*id*/ = 0) {}
|
||||||
virtual ObjectGuid GetGUID(int32 /*id*/ = 0) const { return ObjectGuid::Empty; }
|
virtual ObjectGuid GetGUID(int32 /*id*/ = 0) const { return ObjectGuid::Empty; }
|
||||||
|
|
||||||
// Select the best target (in <targetType> order) from the threat list that fulfill the following:
|
// Select the best target (in <targetType> order) from the threat list that fulfill the following:
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItem
|
|||||||
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(gossipMenuID, gossipMenuItemID, sender, action, boxMoney);
|
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(gossipMenuID, gossipMenuItemID, sender, action, boxMoney);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const guid)
|
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
player->PlayerTalkClass->SendGossipMenu(npcTextID, guid);
|
player->PlayerTalkClass->SendGossipMenu(npcTextID, guid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ void AddGossipItemFor(Player* player, uint32 icon, std::string const& text, uint
|
|||||||
void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action, uint32 boxMoney = 0);
|
void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action, uint32 boxMoney = 0);
|
||||||
|
|
||||||
// Send menu text
|
// Send menu text
|
||||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const guid);
|
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const& guid);
|
||||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, Creature const* creature);
|
void SendGossipMenuFor(Player* player, uint32 npcTextID, Creature const* creature);
|
||||||
|
|
||||||
// Close menu
|
// Close menu
|
||||||
|
|||||||
@@ -993,7 +993,7 @@ void SmartAI::SetData(uint32 id, uint32 value, WorldObject* invoker)
|
|||||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, unit, id, value, false, nullptr, gob);
|
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, unit, id, value, false, nullptr, gob);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SmartAI::SetGUID(ObjectGuid /*guid*/, int32 /*id*/)
|
void SmartAI::SetGUID(ObjectGuid const& /*guid*/, int32 /*id*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public:
|
|||||||
void SetData(uint32 id, uint32 value, WorldObject* invoker);
|
void SetData(uint32 id, uint32 value, WorldObject* invoker);
|
||||||
|
|
||||||
// Used in scripts to share variables
|
// Used in scripts to share variables
|
||||||
void SetGUID(ObjectGuid guid, int32 id = 0) override;
|
void SetGUID(ObjectGuid const& guid, int32 id = 0) override;
|
||||||
|
|
||||||
// Used in scripts to share variables
|
// Used in scripts to share variables
|
||||||
ObjectGuid GetGUID(int32 id = 0) const override;
|
ObjectGuid GetGUID(int32 id = 0) const override;
|
||||||
|
|||||||
@@ -855,7 +855,7 @@ GameObject* Battlefield::SpawnGameObject(uint32 entry, float x, float y, float z
|
|||||||
return go;
|
return go;
|
||||||
}
|
}
|
||||||
|
|
||||||
Creature* Battlefield::GetCreature(ObjectGuid const guid)
|
Creature* Battlefield::GetCreature(ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
if (!m_Map)
|
if (!m_Map)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -863,7 +863,7 @@ Creature* Battlefield::GetCreature(ObjectGuid const guid)
|
|||||||
return m_Map->GetCreature(guid);
|
return m_Map->GetCreature(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject* Battlefield::GetGameObject(ObjectGuid const guid)
|
GameObject* Battlefield::GetGameObject(ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
if (!m_Map)
|
if (!m_Map)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -303,8 +303,8 @@ public:
|
|||||||
Creature* SpawnCreature(uint32 entry, Position pos, TeamId teamId);
|
Creature* SpawnCreature(uint32 entry, Position pos, TeamId teamId);
|
||||||
GameObject* SpawnGameObject(uint32 entry, float x, float y, float z, float o);
|
GameObject* SpawnGameObject(uint32 entry, float x, float y, float z, float o);
|
||||||
|
|
||||||
Creature* GetCreature(ObjectGuid const guid);
|
Creature* GetCreature(ObjectGuid const& guid);
|
||||||
GameObject* GetGameObject(ObjectGuid const guid);
|
GameObject* GetGameObject(ObjectGuid const& guid);
|
||||||
|
|
||||||
// Script-methods
|
// Script-methods
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ void Corpse::DeleteFromDB(CharacterDatabaseTransaction trans)
|
|||||||
DeleteFromDB(GetOwnerGUID(), trans);
|
DeleteFromDB(GetOwnerGUID(), trans);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Corpse::DeleteFromDB(ObjectGuid const ownerGuid, CharacterDatabaseTransaction trans)
|
void Corpse::DeleteFromDB(ObjectGuid const& ownerGuid, CharacterDatabaseTransaction trans)
|
||||||
{
|
{
|
||||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE);
|
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE);
|
||||||
stmt->SetData(0, ownerGuid.GetCounter());
|
stmt->SetData(0, ownerGuid.GetCounter());
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
bool LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields);
|
bool LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields);
|
||||||
|
|
||||||
void DeleteFromDB(CharacterDatabaseTransaction trans);
|
void DeleteFromDB(CharacterDatabaseTransaction trans);
|
||||||
static void DeleteFromDB(ObjectGuid const ownerGuid, CharacterDatabaseTransaction trans);
|
static void DeleteFromDB(ObjectGuid const& ownerGuid, CharacterDatabaseTransaction trans);
|
||||||
|
|
||||||
[[nodiscard]] ObjectGuid GetOwnerGUID() const { return GetGuidValue(CORPSE_FIELD_OWNER); }
|
[[nodiscard]] ObjectGuid GetOwnerGUID() const { return GetGuidValue(CORPSE_FIELD_OWNER); }
|
||||||
|
|
||||||
|
|||||||
@@ -3051,13 +3051,13 @@ SpellInfo const* GameObject::GetSpellForLock(Player const* player) const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameObject::AddToSkillupList(ObjectGuid playerGuid)
|
void GameObject::AddToSkillupList(ObjectGuid const& playerGuid)
|
||||||
{
|
{
|
||||||
int32 timer = GetMap()->IsDungeon() ? -1 : 10 * MINUTE * IN_MILLISECONDS;
|
int32 timer = GetMap()->IsDungeon() ? -1 : 10 * MINUTE * IN_MILLISECONDS;
|
||||||
m_SkillupList[playerGuid] = timer;
|
m_SkillupList[playerGuid] = timer;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameObject::IsInSkillupList(ObjectGuid playerGuid) const
|
bool GameObject::IsInSkillupList(ObjectGuid const& playerGuid) const
|
||||||
{
|
{
|
||||||
for (auto const& itr : m_SkillupList)
|
for (auto const& itr : m_SkillupList)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -231,8 +231,8 @@ public:
|
|||||||
void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }
|
void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }
|
||||||
void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; }
|
void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; }
|
||||||
|
|
||||||
void AddToSkillupList(ObjectGuid playerGuid);
|
void AddToSkillupList(ObjectGuid const& playerGuid);
|
||||||
[[nodiscard]] bool IsInSkillupList(ObjectGuid playerGuid) const;
|
[[nodiscard]] bool IsInSkillupList(ObjectGuid const& playerGuid) const;
|
||||||
|
|
||||||
void AddUniqueUse(Player* player);
|
void AddUniqueUse(Player* player);
|
||||||
void AddUse() { ++m_usetimes; }
|
void AddUse() { ++m_usetimes; }
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ class PackedGuid
|
|||||||
explicit PackedGuid(ObjectGuid guid) : _packedGuid(PACKED_GUID_MIN_BUFFER_SIZE) { _packedGuid.appendPackGUID(guid.GetRawValue()); }
|
explicit PackedGuid(ObjectGuid guid) : _packedGuid(PACKED_GUID_MIN_BUFFER_SIZE) { _packedGuid.appendPackGUID(guid.GetRawValue()); }
|
||||||
|
|
||||||
void Set(uint64 guid) { _packedGuid.wpos(0); _packedGuid.appendPackGUID(guid); }
|
void Set(uint64 guid) { _packedGuid.wpos(0); _packedGuid.appendPackGUID(guid); }
|
||||||
void Set(ObjectGuid guid) { _packedGuid.wpos(0); _packedGuid.appendPackGUID(guid.GetRawValue()); }
|
void Set(ObjectGuid const& guid) { _packedGuid.wpos(0); _packedGuid.appendPackGUID(guid.GetRawValue()); }
|
||||||
|
|
||||||
[[nodiscard]] std::size_t size() const { return _packedGuid.size(); }
|
[[nodiscard]] std::size_t size() const { return _packedGuid.size(); }
|
||||||
|
|
||||||
|
|||||||
@@ -2088,7 +2088,7 @@ bool Player::CanInteractWithQuestGiver(Object* questGiver)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
|
Creature* Player::GetNPCIfCanInteractWith(ObjectGuid const& guid, uint32 npcflagmask)
|
||||||
{
|
{
|
||||||
// unit checks
|
// unit checks
|
||||||
if (!guid)
|
if (!guid)
|
||||||
@@ -2145,7 +2145,7 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
|
|||||||
return creature;
|
return creature;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, GameobjectTypes type) const
|
GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid const& guid, GameobjectTypes type) const
|
||||||
{
|
{
|
||||||
if (GameObject* go = GetMap()->GetGameObject(guid))
|
if (GameObject* go = GetMap()->GetGameObject(guid))
|
||||||
{
|
{
|
||||||
@@ -4616,7 +4616,7 @@ void Player::KillPlayer()
|
|||||||
//UpdateObjectVisibility(); // pussywizard: not needed
|
//UpdateObjectVisibility(); // pussywizard: not needed
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::OfflineResurrect(ObjectGuid const guid, CharacterDatabaseTransaction trans)
|
void Player::OfflineResurrect(ObjectGuid const& guid, CharacterDatabaseTransaction trans)
|
||||||
{
|
{
|
||||||
Corpse::DeleteFromDB(guid, trans);
|
Corpse::DeleteFromDB(guid, trans);
|
||||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||||
|
|||||||
@@ -1128,8 +1128,8 @@ public:
|
|||||||
void SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint32 time, bool onEnterMap);
|
void SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint32 time, bool onEnterMap);
|
||||||
|
|
||||||
bool CanInteractWithQuestGiver(Object* questGiver);
|
bool CanInteractWithQuestGiver(Object* questGiver);
|
||||||
Creature* GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask);
|
Creature* GetNPCIfCanInteractWith(ObjectGuid const& guid, uint32 npcflagmask);
|
||||||
[[nodiscard]] GameObject* GetGameObjectIfCanInteractWith(ObjectGuid guid, GameobjectTypes type) const;
|
[[nodiscard]] GameObject* GetGameObjectIfCanInteractWith(ObjectGuid const& guid, GameobjectTypes type) const;
|
||||||
|
|
||||||
void ToggleAFK();
|
void ToggleAFK();
|
||||||
void ToggleDND();
|
void ToggleDND();
|
||||||
@@ -2033,7 +2033,7 @@ public:
|
|||||||
Corpse* CreateCorpse();
|
Corpse* CreateCorpse();
|
||||||
void RemoveCorpse();
|
void RemoveCorpse();
|
||||||
void KillPlayer();
|
void KillPlayer();
|
||||||
static void OfflineResurrect(ObjectGuid const guid, CharacterDatabaseTransaction trans);
|
static void OfflineResurrect(ObjectGuid const& guid, CharacterDatabaseTransaction trans);
|
||||||
[[nodiscard]] bool HasCorpse() const { return _corpseLocation.GetMapId() != MAPID_INVALID; }
|
[[nodiscard]] bool HasCorpse() const { return _corpseLocation.GetMapId() != MAPID_INVALID; }
|
||||||
[[nodiscard]] WorldLocation GetCorpseLocation() const { return _corpseLocation; }
|
[[nodiscard]] WorldLocation GetCorpseLocation() const { return _corpseLocation; }
|
||||||
uint32 GetResurrectionSpellId();
|
uint32 GetResurrectionSpellId();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag) const
|
|||||||
return counter;
|
return counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerSocial::AddToSocialList(ObjectGuid friendGuid, SocialFlag flag)
|
bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, SocialFlag flag)
|
||||||
{
|
{
|
||||||
// check client limits
|
// check client limits
|
||||||
if (GetNumberOfSocialsWithFlag(flag) >= (((flag & SOCIAL_FLAG_FRIEND) != 0) ? SOCIALMGR_FRIEND_LIMIT : SOCIALMGR_IGNORE_LIMIT))
|
if (GetNumberOfSocialsWithFlag(flag) >= (((flag & SOCIAL_FLAG_FRIEND) != 0) ? SOCIALMGR_FRIEND_LIMIT : SOCIALMGR_IGNORE_LIMIT))
|
||||||
@@ -71,7 +71,7 @@ bool PlayerSocial::AddToSocialList(ObjectGuid friendGuid, SocialFlag flag)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerSocial::RemoveFromSocialList(ObjectGuid friendGuid, SocialFlag flag)
|
void PlayerSocial::RemoveFromSocialList(ObjectGuid const& friendGuid, SocialFlag flag)
|
||||||
{
|
{
|
||||||
auto itr = m_playerSocialMap.find(friendGuid);
|
auto itr = m_playerSocialMap.find(friendGuid);
|
||||||
if (itr == m_playerSocialMap.end()) // not exist
|
if (itr == m_playerSocialMap.end()) // not exist
|
||||||
@@ -102,7 +102,7 @@ void PlayerSocial::RemoveFromSocialList(ObjectGuid friendGuid, SocialFlag flag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerSocial::SetFriendNote(ObjectGuid friendGuid, std::string note)
|
void PlayerSocial::SetFriendNote(ObjectGuid const& friendGuid, std::string note)
|
||||||
{
|
{
|
||||||
auto itr = m_playerSocialMap.find(friendGuid);
|
auto itr = m_playerSocialMap.find(friendGuid);
|
||||||
if (itr == m_playerSocialMap.end()) // not exist
|
if (itr == m_playerSocialMap.end()) // not exist
|
||||||
@@ -176,7 +176,7 @@ void PlayerSocial::SendSocialList(Player* player, uint32 flags)
|
|||||||
LOG_DEBUG("network", "WORLD: Sent SMSG_CONTACT_LIST");
|
LOG_DEBUG("network", "WORLD: Sent SMSG_CONTACT_LIST");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerSocial::_checkContact(ObjectGuid guid, SocialFlag flags) const
|
bool PlayerSocial::_checkContact(ObjectGuid const& guid, SocialFlag flags) const
|
||||||
{
|
{
|
||||||
auto const& itr = m_playerSocialMap.find(guid);
|
auto const& itr = m_playerSocialMap.find(guid);
|
||||||
if (itr != m_playerSocialMap.end())
|
if (itr != m_playerSocialMap.end())
|
||||||
@@ -185,12 +185,12 @@ bool PlayerSocial::_checkContact(ObjectGuid guid, SocialFlag flags) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerSocial::HasFriend(ObjectGuid friend_guid) const
|
bool PlayerSocial::HasFriend(ObjectGuid const& friend_guid) const
|
||||||
{
|
{
|
||||||
return _checkContact(friend_guid, SOCIAL_FLAG_FRIEND);
|
return _checkContact(friend_guid, SOCIAL_FLAG_FRIEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerSocial::HasIgnore(ObjectGuid ignore_guid) const
|
bool PlayerSocial::HasIgnore(ObjectGuid const& ignore_guid) const
|
||||||
{
|
{
|
||||||
return _checkContact(ignore_guid, SOCIAL_FLAG_IGNORED);
|
return _checkContact(ignore_guid, SOCIAL_FLAG_IGNORED);
|
||||||
}
|
}
|
||||||
@@ -209,7 +209,7 @@ SocialMgr* SocialMgr::instance()
|
|||||||
return &instance;
|
return &instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SocialMgr::GetFriendInfo(Player* player, ObjectGuid friendGUID, FriendInfo& friendInfo)
|
void SocialMgr::GetFriendInfo(Player* player, ObjectGuid const& friendGUID, FriendInfo& friendInfo)
|
||||||
{
|
{
|
||||||
if (!player)
|
if (!player)
|
||||||
return;
|
return;
|
||||||
@@ -247,14 +247,14 @@ void SocialMgr::GetFriendInfo(Player* player, ObjectGuid friendGUID, FriendInfo&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SocialMgr::MakeFriendStatusPacket(FriendsResult result, ObjectGuid guid, WorldPacket* data)
|
void SocialMgr::MakeFriendStatusPacket(FriendsResult result, ObjectGuid const& guid, WorldPacket* data)
|
||||||
{
|
{
|
||||||
data->Initialize(SMSG_FRIEND_STATUS, 9);
|
data->Initialize(SMSG_FRIEND_STATUS, 9);
|
||||||
*data << uint8(result);
|
*data << uint8(result);
|
||||||
*data << guid;
|
*data << guid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SocialMgr::SendFriendStatus(Player* player, FriendsResult result, ObjectGuid friendGuid, bool broadcast)
|
void SocialMgr::SendFriendStatus(Player* player, FriendsResult result, ObjectGuid const& friendGuid, bool broadcast)
|
||||||
{
|
{
|
||||||
FriendInfo fi;
|
FriendInfo fi;
|
||||||
GetFriendInfo(player, friendGuid, fi);
|
GetFriendInfo(player, friendGuid, fi);
|
||||||
@@ -316,7 +316,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, ObjectGuid guid)
|
PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
PlayerSocial* social = &m_socialMap[guid];
|
PlayerSocial* social = &m_socialMap[guid];
|
||||||
social->SetPlayerGUID(guid);
|
social->SetPlayerGUID(guid);
|
||||||
|
|||||||
@@ -104,19 +104,19 @@ class PlayerSocial
|
|||||||
public:
|
public:
|
||||||
PlayerSocial();
|
PlayerSocial();
|
||||||
// adding/removing
|
// adding/removing
|
||||||
bool AddToSocialList(ObjectGuid friend_guid, SocialFlag flag);
|
bool AddToSocialList(ObjectGuid const& friend_guid, SocialFlag flag);
|
||||||
void RemoveFromSocialList(ObjectGuid friend_guid, SocialFlag flag);
|
void RemoveFromSocialList(ObjectGuid const& friend_guid, SocialFlag flag);
|
||||||
void SetFriendNote(ObjectGuid friendGuid, std::string note);
|
void SetFriendNote(ObjectGuid const& friendGuid, std::string note);
|
||||||
// Packet send's
|
// Packet send's
|
||||||
void SendSocialList(Player* player, uint32 flags);
|
void SendSocialList(Player* player, uint32 flags);
|
||||||
// Misc
|
// Misc
|
||||||
bool HasFriend(ObjectGuid friend_guid) const;
|
bool HasFriend(ObjectGuid const& friend_guid) const;
|
||||||
bool HasIgnore(ObjectGuid ignore_guid) const;
|
bool HasIgnore(ObjectGuid const& ignore_guid) const;
|
||||||
ObjectGuid GetPlayerGUID() const { return m_playerGUID; }
|
ObjectGuid const& GetPlayerGUID() const { return m_playerGUID; }
|
||||||
void SetPlayerGUID(ObjectGuid guid) { m_playerGUID = guid; }
|
void SetPlayerGUID(ObjectGuid const& guid) { m_playerGUID = guid; }
|
||||||
uint32 GetNumberOfSocialsWithFlag(SocialFlag flag) const;
|
uint32 GetNumberOfSocialsWithFlag(SocialFlag flag) const;
|
||||||
private:
|
private:
|
||||||
bool _checkContact(ObjectGuid guid, SocialFlag flags) const;
|
bool _checkContact(ObjectGuid const& guid, SocialFlag flags) const;
|
||||||
typedef std::map<ObjectGuid, FriendInfo> PlayerSocialMap;
|
typedef std::map<ObjectGuid, FriendInfo> PlayerSocialMap;
|
||||||
PlayerSocialMap m_playerSocialMap;
|
PlayerSocialMap m_playerSocialMap;
|
||||||
ObjectGuid m_playerGUID;
|
ObjectGuid m_playerGUID;
|
||||||
@@ -131,14 +131,14 @@ class SocialMgr
|
|||||||
public:
|
public:
|
||||||
static SocialMgr* instance();
|
static SocialMgr* instance();
|
||||||
// Misc
|
// Misc
|
||||||
void RemovePlayerSocial(ObjectGuid guid) { m_socialMap.erase(guid); }
|
void RemovePlayerSocial(ObjectGuid const& guid) { m_socialMap.erase(guid); }
|
||||||
static void GetFriendInfo(Player* player, ObjectGuid friendGUID, FriendInfo& friendInfo);
|
static void GetFriendInfo(Player* player, ObjectGuid const& friendGUID, FriendInfo& friendInfo);
|
||||||
// Packet management
|
// Packet management
|
||||||
void MakeFriendStatusPacket(FriendsResult result, ObjectGuid friend_guid, WorldPacket* data);
|
void MakeFriendStatusPacket(FriendsResult result, ObjectGuid const& friend_guid, WorldPacket* data);
|
||||||
void SendFriendStatus(Player* player, FriendsResult result, ObjectGuid friend_guid, bool broadcast);
|
void SendFriendStatus(Player* player, FriendsResult result, ObjectGuid const& friend_guid, bool broadcast);
|
||||||
void BroadcastToFriendListers(Player* player, WorldPacket* packet);
|
void BroadcastToFriendListers(Player* player, WorldPacket* packet);
|
||||||
// Loading
|
// Loading
|
||||||
PlayerSocial* LoadFromDB(PreparedQueryResult result, ObjectGuid guid);
|
PlayerSocial* LoadFromDB(PreparedQueryResult result, ObjectGuid const& guid);
|
||||||
private:
|
private:
|
||||||
typedef std::map<ObjectGuid, PlayerSocial> SocialMap;
|
typedef std::map<ObjectGuid, PlayerSocial> SocialMap;
|
||||||
SocialMap m_socialMap;
|
SocialMap m_socialMap;
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ namespace PlayerNameMapHolder
|
|||||||
|
|
||||||
} // namespace PlayerNameMapHolder
|
} // namespace PlayerNameMapHolder
|
||||||
|
|
||||||
WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, ObjectGuid const guid)
|
WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
switch (guid.GetHigh())
|
switch (guid.GetHigh())
|
||||||
{
|
{
|
||||||
@@ -138,7 +138,7 @@ WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, ObjectGuid con
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, ObjectGuid const guid, uint32 typemask)
|
Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, ObjectGuid const& guid, uint32 typemask)
|
||||||
{
|
{
|
||||||
switch (guid.GetHigh())
|
switch (guid.GetHigh())
|
||||||
{
|
{
|
||||||
@@ -176,27 +176,27 @@ Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, ObjectGuid con
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Corpse* ObjectAccessor::GetCorpse(WorldObject const& u, ObjectGuid const guid)
|
Corpse* ObjectAccessor::GetCorpse(WorldObject const& u, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return u.GetMap()->GetCorpse(guid);
|
return u.GetMap()->GetCorpse(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject* ObjectAccessor::GetGameObject(WorldObject const& u, ObjectGuid const guid)
|
GameObject* ObjectAccessor::GetGameObject(WorldObject const& u, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return u.GetMap()->GetGameObject(guid);
|
return u.GetMap()->GetGameObject(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Transport* ObjectAccessor::GetTransport(WorldObject const& u, ObjectGuid const guid)
|
Transport* ObjectAccessor::GetTransport(WorldObject const& u, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return u.GetMap()->GetTransport(guid);
|
return u.GetMap()->GetTransport(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicObject* ObjectAccessor::GetDynamicObject(WorldObject const& u, ObjectGuid const guid)
|
DynamicObject* ObjectAccessor::GetDynamicObject(WorldObject const& u, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return u.GetMap()->GetDynamicObject(guid);
|
return u.GetMap()->GetDynamicObject(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit* ObjectAccessor::GetUnit(WorldObject const& u, ObjectGuid const guid)
|
Unit* ObjectAccessor::GetUnit(WorldObject const& u, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
if (guid.IsPlayer())
|
if (guid.IsPlayer())
|
||||||
return GetPlayer(u, guid);
|
return GetPlayer(u, guid);
|
||||||
@@ -207,17 +207,17 @@ Unit* ObjectAccessor::GetUnit(WorldObject const& u, ObjectGuid const guid)
|
|||||||
return GetCreature(u, guid);
|
return GetCreature(u, guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Creature* ObjectAccessor::GetCreature(WorldObject const& u, ObjectGuid const guid)
|
Creature* ObjectAccessor::GetCreature(WorldObject const& u, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return u.GetMap()->GetCreature(guid);
|
return u.GetMap()->GetCreature(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Pet* ObjectAccessor::GetPet(WorldObject const& u, ObjectGuid const guid)
|
Pet* ObjectAccessor::GetPet(WorldObject const& u, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return u.GetMap()->GetPet(guid);
|
return u.GetMap()->GetPet(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Player* ObjectAccessor::GetPlayer(Map const* m, ObjectGuid const guid)
|
Player* ObjectAccessor::GetPlayer(Map const* m, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
if (Player * player = HashMapHolder<Player>::Find(guid))
|
if (Player * player = HashMapHolder<Player>::Find(guid))
|
||||||
if (player->IsInWorld() && player->GetMap() == m)
|
if (player->IsInWorld() && player->GetMap() == m)
|
||||||
@@ -226,12 +226,12 @@ Player* ObjectAccessor::GetPlayer(Map const* m, ObjectGuid const guid)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player* ObjectAccessor::GetPlayer(WorldObject const& u, ObjectGuid const guid)
|
Player* ObjectAccessor::GetPlayer(WorldObject const& u, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return GetPlayer(u.GetMap(), guid);
|
return GetPlayer(u.GetMap(), guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const& u, ObjectGuid const guid)
|
Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const& u, ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
if (guid.IsPet())
|
if (guid.IsPet())
|
||||||
return GetPet(u, guid);
|
return GetPet(u, guid);
|
||||||
|
|||||||
@@ -60,18 +60,18 @@ public:
|
|||||||
namespace ObjectAccessor
|
namespace ObjectAccessor
|
||||||
{
|
{
|
||||||
// these functions return objects only if in map of specified object
|
// these functions return objects only if in map of specified object
|
||||||
WorldObject* GetWorldObject(WorldObject const&, ObjectGuid const guid);
|
WorldObject* GetWorldObject(WorldObject const&, ObjectGuid const& guid);
|
||||||
Object* GetObjectByTypeMask(WorldObject const&, ObjectGuid const guid, uint32 typemask);
|
Object* GetObjectByTypeMask(WorldObject const&, ObjectGuid const& guid, uint32 typemask);
|
||||||
Corpse* GetCorpse(WorldObject const& u, ObjectGuid const guid);
|
Corpse* GetCorpse(WorldObject const& u, ObjectGuid const& guid);
|
||||||
GameObject* GetGameObject(WorldObject const& u, ObjectGuid const guid);
|
GameObject* GetGameObject(WorldObject const& u, ObjectGuid const& guid);
|
||||||
Transport* GetTransport(WorldObject const& u, ObjectGuid const guid);
|
Transport* GetTransport(WorldObject const& u, ObjectGuid const& guid);
|
||||||
DynamicObject* GetDynamicObject(WorldObject const& u, ObjectGuid const guid);
|
DynamicObject* GetDynamicObject(WorldObject const& u, ObjectGuid const& guid);
|
||||||
Unit* GetUnit(WorldObject const&, ObjectGuid const guid);
|
Unit* GetUnit(WorldObject const&, ObjectGuid const& guid);
|
||||||
Creature* GetCreature(WorldObject const& u, ObjectGuid const guid);
|
Creature* GetCreature(WorldObject const& u, ObjectGuid const& guid);
|
||||||
Pet* GetPet(WorldObject const&, ObjectGuid const guid);
|
Pet* GetPet(WorldObject const&, ObjectGuid const& guid);
|
||||||
Player* GetPlayer(Map const*, ObjectGuid const guid);
|
Player* GetPlayer(Map const*, ObjectGuid const& guid);
|
||||||
Player* GetPlayer(WorldObject const&, ObjectGuid const guid);
|
Player* GetPlayer(WorldObject const&, ObjectGuid const& guid);
|
||||||
Creature* GetCreatureOrPetOrVehicle(WorldObject const&, ObjectGuid const);
|
Creature* GetCreatureOrPetOrVehicle(WorldObject const&, ObjectGuid const&);
|
||||||
|
|
||||||
// these functions return objects if found in whole world
|
// these functions return objects if found in whole world
|
||||||
// ACCESS LIKE THAT IS NOT THREAD SAFE
|
// ACCESS LIKE THAT IS NOT THREAD SAFE
|
||||||
|
|||||||
@@ -2358,27 +2358,27 @@ void BattlegroundMap::RemoveAllPlayers()
|
|||||||
player->TeleportTo(player->GetEntryPoint());
|
player->TeleportTo(player->GetEntryPoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
Corpse* Map::GetCorpse(ObjectGuid const guid)
|
Corpse* Map::GetCorpse(ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return _objectsStore.Find<Corpse>(guid);
|
return _objectsStore.Find<Corpse>(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Creature* Map::GetCreature(ObjectGuid const guid)
|
Creature* Map::GetCreature(ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return _objectsStore.Find<Creature>(guid);
|
return _objectsStore.Find<Creature>(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject* Map::GetGameObject(ObjectGuid const guid)
|
GameObject* Map::GetGameObject(ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return _objectsStore.Find<GameObject>(guid);
|
return _objectsStore.Find<GameObject>(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Pet* Map::GetPet(ObjectGuid const guid)
|
Pet* Map::GetPet(ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return dynamic_cast<Pet*>(_objectsStore.Find<Creature>(guid));
|
return dynamic_cast<Pet*>(_objectsStore.Find<Creature>(guid));
|
||||||
}
|
}
|
||||||
|
|
||||||
Transport* Map::GetTransport(ObjectGuid guid)
|
Transport* Map::GetTransport(ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
if (guid.GetHigh() != HighGuid::Mo_Transport && guid.GetHigh() != HighGuid::Transport)
|
if (guid.GetHigh() != HighGuid::Mo_Transport && guid.GetHigh() != HighGuid::Transport)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -2387,7 +2387,7 @@ Transport* Map::GetTransport(ObjectGuid guid)
|
|||||||
return go ? go->ToTransport() : nullptr;
|
return go ? go->ToTransport() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicObject* Map::GetDynamicObject(ObjectGuid guid)
|
DynamicObject* Map::GetDynamicObject(ObjectGuid const& guid)
|
||||||
{
|
{
|
||||||
return _objectsStore.Find<DynamicObject>(guid);
|
return _objectsStore.Find<DynamicObject>(guid);
|
||||||
}
|
}
|
||||||
@@ -2679,7 +2679,7 @@ void Map::RemoveCorpse(Corpse* corpse)
|
|||||||
_corpseBones.erase(corpse);
|
_corpseBones.erase(corpse);
|
||||||
}
|
}
|
||||||
|
|
||||||
Corpse* Map::ConvertCorpseToBones(ObjectGuid const ownerGuid, bool insignia /*= false*/)
|
Corpse* Map::ConvertCorpseToBones(ObjectGuid const& ownerGuid, bool insignia /*= false*/)
|
||||||
{
|
{
|
||||||
Corpse* corpse = GetCorpseByPlayer(ownerGuid);
|
Corpse* corpse = GetCorpseByPlayer(ownerGuid);
|
||||||
if (!corpse)
|
if (!corpse)
|
||||||
|
|||||||
@@ -338,12 +338,12 @@ public:
|
|||||||
GameObject* SummonGameObject(uint32 entry, Position const& pos, float rotation0 = 0.0f, float rotation1 = 0.0f, float rotation2 = 0.0f, float rotation3 = 0.0f, uint32 respawnTime = 100, bool checkTransport = true);
|
GameObject* SummonGameObject(uint32 entry, Position const& pos, float rotation0 = 0.0f, float rotation1 = 0.0f, float rotation2 = 0.0f, float rotation3 = 0.0f, uint32 respawnTime = 100, bool checkTransport = true);
|
||||||
void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = nullptr);
|
void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = nullptr);
|
||||||
|
|
||||||
Corpse* GetCorpse(ObjectGuid const guid);
|
Corpse* GetCorpse(ObjectGuid const& guid);
|
||||||
Creature* GetCreature(ObjectGuid const guid);
|
Creature* GetCreature(ObjectGuid const& guid);
|
||||||
GameObject* GetGameObject(ObjectGuid const guid);
|
GameObject* GetGameObject(ObjectGuid const& guid);
|
||||||
Transport* GetTransport(ObjectGuid const guid);
|
Transport* GetTransport(ObjectGuid const& guid);
|
||||||
DynamicObject* GetDynamicObject(ObjectGuid const guid);
|
DynamicObject* GetDynamicObject(ObjectGuid const& guid);
|
||||||
Pet* GetPet(ObjectGuid const guid);
|
Pet* GetPet(ObjectGuid const& guid);
|
||||||
|
|
||||||
MapStoredObjectTypesContainer& GetObjectsStore() { return _objectsStore; }
|
MapStoredObjectTypesContainer& GetObjectsStore() { return _objectsStore; }
|
||||||
|
|
||||||
@@ -438,7 +438,7 @@ public:
|
|||||||
void DeleteCorpseData();
|
void DeleteCorpseData();
|
||||||
void AddCorpse(Corpse* corpse);
|
void AddCorpse(Corpse* corpse);
|
||||||
void RemoveCorpse(Corpse* corpse);
|
void RemoveCorpse(Corpse* corpse);
|
||||||
Corpse* ConvertCorpseToBones(ObjectGuid const ownerGuid, bool insignia = false);
|
Corpse* ConvertCorpseToBones(ObjectGuid const& ownerGuid, bool insignia = false);
|
||||||
void RemoveOldCorpses();
|
void RemoveOldCorpses();
|
||||||
|
|
||||||
static void DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId);
|
static void DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId);
|
||||||
|
|||||||
@@ -852,7 +852,7 @@ void WorldState::HandleSunsReachSubPhaseTransition(int32 subPhaseMask, bool init
|
|||||||
if (!initial)
|
if (!initial)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> guard(m_sunsReachData.m_sunsReachReclamationMutex);
|
std::lock_guard<std::mutex> guard(m_sunsReachData.m_sunsReachReclamationMutex);
|
||||||
for (ObjectGuid& guid : m_sunsReachData.m_sunsReachReclamationPlayers)
|
for (ObjectGuid const& guid : m_sunsReachData.m_sunsReachReclamationPlayers)
|
||||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||||
{
|
{
|
||||||
if (start)
|
if (start)
|
||||||
|
|||||||
+1
-1
@@ -118,7 +118,7 @@ public:
|
|||||||
return !victim->HasAura(SPELL_TIMELAPSE);
|
return !victim->HasAura(SPELL_TIMELAPSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 id) override
|
void SetGUID(ObjectGuid const& guid, int32 id) override
|
||||||
{
|
{
|
||||||
if (id == GUID_LEVER_USER)
|
if (id == GUID_LEVER_USER)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -152,7 +152,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid const guid, int32 /*id*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
|
||||||
{
|
{
|
||||||
_charmerGUID = guid;
|
_charmerGUID = guid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 index) override
|
void SetGUID(ObjectGuid const& guid, int32 index) override
|
||||||
{
|
{
|
||||||
if (index == GO_LAVA_BURST)
|
if (index == GO_LAVA_BURST)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public:
|
|||||||
uint32 checkTimer;
|
uint32 checkTimer;
|
||||||
ObjectGuid playerGUID;
|
ObjectGuid playerGUID;
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32) override
|
void SetGUID(ObjectGuid const& guid, int32) override
|
||||||
{
|
{
|
||||||
playerGUID = guid;
|
playerGUID = guid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ struct boss_shade_of_aran : public BossAI
|
|||||||
return me->GetDistance2d(roomCenter.GetPositionX(), roomCenter.GetPositionY()) < 45.0f;
|
return me->GetDistance2d(roomCenter.GetPositionX(), roomCenter.GetPositionY()) < 45.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 id) override
|
void SetGUID(ObjectGuid const& guid, int32 id) override
|
||||||
{
|
{
|
||||||
if (id == ACTION_ATIESH_REACT && !_atieshReaction)
|
if (id == ACTION_ATIESH_REACT && !_atieshReaction)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ public:
|
|||||||
AttackStart(attacker);
|
AttackStart(attacker);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32) override
|
void SetGUID(ObjectGuid const& guid, int32) override
|
||||||
{
|
{
|
||||||
gothikGUID = guid;
|
gothikGUID = guid;
|
||||||
events.ScheduleEvent(EVENT_GHOUL_MOVE_TO_PIT, 3s);
|
events.ScheduleEvent(EVENT_GHOUL_MOVE_TO_PIT, 3s);
|
||||||
@@ -806,7 +806,7 @@ public:
|
|||||||
|
|
||||||
ObjectGuid prisonerGUID;
|
ObjectGuid prisonerGUID;
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 /*id*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
|
||||||
{
|
{
|
||||||
if (!prisonerGUID)
|
if (!prisonerGUID)
|
||||||
prisonerGUID = guid;
|
prisonerGUID = guid;
|
||||||
@@ -866,7 +866,7 @@ public:
|
|||||||
|
|
||||||
ObjectGuid minerGUID;
|
ObjectGuid minerGUID;
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 /*id*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
|
||||||
{
|
{
|
||||||
minerGUID = guid;
|
minerGUID = guid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid const guid, int32 type) override
|
void SetGUID(ObjectGuid const& guid, int32 type) override
|
||||||
{
|
{
|
||||||
if (type == ACTION_CHARGE)
|
if (type == ACTION_CHARGE)
|
||||||
{
|
{
|
||||||
@@ -564,7 +564,7 @@ public:
|
|||||||
RevivePlayer(victim, reviveGUID);
|
RevivePlayer(victim, reviveGUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid const guid, int32 /*type = 0 */) override
|
void SetGUID(ObjectGuid const& guid, int32 /*type = 0 */) override
|
||||||
{
|
{
|
||||||
reviveGUID = guid;
|
reviveGUID = guid;
|
||||||
}
|
}
|
||||||
@@ -612,7 +612,7 @@ public:
|
|||||||
revivePlayerGUID.Clear();
|
revivePlayerGUID.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid const guid, int32 /*id*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
|
||||||
{
|
{
|
||||||
revivePlayerGUID = guid;
|
revivePlayerGUID = guid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public:
|
|||||||
_faction = faction;
|
_faction = faction;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32) override
|
void SetGUID(ObjectGuid const& guid, int32) override
|
||||||
{
|
{
|
||||||
_playerGUID = guid;
|
_playerGUID = guid;
|
||||||
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public:
|
|||||||
_events.ScheduleEvent(EVENT_MULTI_SHOT, 10s);
|
_events.ScheduleEvent(EVENT_MULTI_SHOT, 10s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 type) override
|
void SetGUID(ObjectGuid const& guid, int32 type) override
|
||||||
{
|
{
|
||||||
if (type == GUID_EVENT_INVOKER)
|
if (type == GUID_EVENT_INVOKER)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1743,7 +1743,7 @@ struct npc_coren_direbrew_sisters : public ScriptedAI
|
|||||||
{
|
{
|
||||||
npc_coren_direbrew_sisters(Creature* creature) : ScriptedAI(creature) { }
|
npc_coren_direbrew_sisters(Creature* creature) : ScriptedAI(creature) { }
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 id) override
|
void SetGUID(ObjectGuid const& guid, int32 id) override
|
||||||
{
|
{
|
||||||
if (id == DATA_TARGET_GUID)
|
if (id == DATA_TARGET_GUID)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ struct boss_archimonde : public BossAI
|
|||||||
Talk(SAY_SLAY);
|
Talk(SAY_SLAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 type) override
|
void SetGUID(ObjectGuid const& guid, int32 type) override
|
||||||
{
|
{
|
||||||
if (type == GUID_GAIN_SOUL_CHARGE_PLAYER)
|
if (type == GUID_GAIN_SOUL_CHARGE_PLAYER)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ struct boss_ossirian : public BossAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 action) override
|
void SetGUID(ObjectGuid const& guid, int32 action) override
|
||||||
{
|
{
|
||||||
if (action == ACTION_TRIGGER_WEAKNESS && guid != _firstCrystalGUID)
|
if (action == ACTION_TRIGGER_WEAKNESS && guid != _firstCrystalGUID)
|
||||||
{
|
{
|
||||||
@@ -317,7 +317,7 @@ public:
|
|||||||
{
|
{
|
||||||
go_ossirian_crystalAI(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }
|
go_ossirian_crystalAI(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 type) override
|
void SetGUID(ObjectGuid const& guid, int32 type) override
|
||||||
{
|
{
|
||||||
if (type == GUID_TRIGGER_PAIR)
|
if (type == GUID_TRIGGER_PAIR)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -552,7 +552,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid /*guid*/, int32 type) override
|
void SetGUID(ObjectGuid const& /*guid*/, int32 type) override
|
||||||
{
|
{
|
||||||
if (type == GUID_SCRIPT_INVOKER && _scriptRunning == false)
|
if (type == GUID_SCRIPT_INVOKER && _scriptRunning == false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public:
|
|||||||
ImmuneFlagSet(false, _faction);
|
ImmuneFlagSet(false, _faction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid playerGUID, int32 faction) override
|
void SetGUID(ObjectGuid const& playerGUID, int32 faction) override
|
||||||
{
|
{
|
||||||
_playerGUID = playerGUID;
|
_playerGUID = playerGUID;
|
||||||
_faction = faction;
|
_faction = faction;
|
||||||
|
|||||||
@@ -1293,7 +1293,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 /*type*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /*type*/) override
|
||||||
{
|
{
|
||||||
_chaseGUID = guid;
|
_chaseGUID = guid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -533,7 +533,7 @@ public:
|
|||||||
return _bloodboltedPlayers.count(guid) != 0;
|
return _bloodboltedPlayers.count(guid) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 type = 0) override
|
void SetGUID(ObjectGuid const& guid, int32 type = 0) override
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -703,7 +703,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 id/* = 0*/) override
|
void SetGUID(ObjectGuid const& guid, int32 id/* = 0*/) override
|
||||||
{
|
{
|
||||||
if (id != ACTION_SHIP_VISITS_ENEMY && id != ACTION_SHIP_VISITS_SELF)
|
if (id != ACTION_SHIP_VISITS_ENEMY && id != ACTION_SHIP_VISITS_SELF)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -745,7 +745,7 @@ public:
|
|||||||
|
|
||||||
ObjectGuid targetGUID;
|
ObjectGuid targetGUID;
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 type) override
|
void SetGUID(ObjectGuid const& guid, int32 type) override
|
||||||
{
|
{
|
||||||
if (type == -1)
|
if (type == -1)
|
||||||
targetGUID = guid;
|
targetGUID = guid;
|
||||||
|
|||||||
@@ -698,7 +698,7 @@ public:
|
|||||||
uint32 _existenceCheckTimer;
|
uint32 _existenceCheckTimer;
|
||||||
uint16 _asphyxiationTimer;
|
uint16 _asphyxiationTimer;
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 type) override
|
void SetGUID(ObjectGuid const& guid, int32 type) override
|
||||||
{
|
{
|
||||||
if (type == DATA_TRAPPED_PLAYER)
|
if (type == DATA_TRAPPED_PLAYER)
|
||||||
_trappedPlayerGUID = guid;
|
_trappedPlayerGUID = guid;
|
||||||
|
|||||||
@@ -2536,7 +2536,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 /* = 0*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /* = 0*/) override
|
||||||
{
|
{
|
||||||
_grabbedPlayer = guid;
|
_grabbedPlayer = guid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -772,7 +772,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 type/* = 0*/) override
|
void SetGUID(ObjectGuid const& guid, int32 type/* = 0*/) override
|
||||||
{
|
{
|
||||||
if (type == ACTION_VRYKUL_DEATH)
|
if (type == ACTION_VRYKUL_DEATH)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1421,7 +1421,7 @@ public:
|
|||||||
_playerGUID.Clear();
|
_playerGUID.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 /*action*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /*action*/) override
|
||||||
{
|
{
|
||||||
if (_playerGUID)
|
if (_playerGUID)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1093,7 +1093,7 @@ public:
|
|||||||
me->GetMotionMaster()->Clear();
|
me->GetMotionMaster()->Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 /*id*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
|
||||||
{
|
{
|
||||||
if (playerGUID || events.HasTimeUntilEvent(998) || events.HasTimeUntilEvent(2))
|
if (playerGUID || events.HasTimeUntilEvent(998) || events.HasTimeUntilEvent(2))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ struct npc_stolen_soul : public ScriptedAI
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 /*id*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
|
||||||
{
|
{
|
||||||
_targetGuid = guid;
|
_targetGuid = guid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ struct boss_murmur : public BossAI
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 index) override
|
void SetGUID(ObjectGuid const& guid, int32 index) override
|
||||||
{
|
{
|
||||||
if (index == GUID_MURMUR_NPCS)
|
if (index == GUID_MURMUR_NPCS)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Used for getting involved player guid. Parameter id is used for defining if is a large(Monument) or small(Relic) node
|
// Used for getting involved player guid. Parameter id is used for defining if is a large(Monument) or small(Relic) node
|
||||||
void SetGUID(ObjectGuid guid, int32 id) override
|
void SetGUID(ObjectGuid const& guid, int32 id) override
|
||||||
{
|
{
|
||||||
me->SetCanFly(true);
|
me->SetCanFly(true);
|
||||||
|
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ public:
|
|||||||
uint32 HealTimer;
|
uint32 HealTimer;
|
||||||
uint32 FrostShockTimer;
|
uint32 FrostShockTimer;
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 /*questId*/) override
|
void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override
|
||||||
{
|
{
|
||||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||||
Start(true, false, guid);
|
Start(true, false, guid);
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public:
|
|||||||
npc_escortAI::MoveInLineOfSight(who);
|
npc_escortAI::MoveInLineOfSight(who);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid playerGUID, int32 type) override
|
void SetGUID(ObjectGuid const& playerGUID, int32 type) override
|
||||||
{
|
{
|
||||||
if (type == DATA_START_ENCOUNTER)
|
if (type == DATA_START_ENCOUNTER)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ public:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetGUID(ObjectGuid guid, int32 type) override
|
void SetGUID(ObjectGuid const& guid, int32 type) override
|
||||||
{
|
{
|
||||||
if (type == GUID_DRAGON)
|
if (type == GUID_DRAGON)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user