From b40f842134e6e1d42d6448dbc0ebd34731458b87 Mon Sep 17 00:00:00 2001 From: SylvaniaCore deploy Date: Wed, 12 Aug 2026 00:31:09 +0200 Subject: [PATCH] BG BotFill : correctif racine de l IA d objectifs - GUID 128 bits tronques en bool Le registre des commandants (PlayerStatus/PlayerGUIDs) etait indexe uint64 ; ObjectGuid (128 bits) s y convertissait via operator bool() -> tous les joueurs partageaient la cle 1. Premier bot enrole, tous les autres rejetes comme doublons, et les recherches inverses (GetBotBGAI) ne trouvaient personne : les commandants ne pilotaient aucun bot. Conteneurs et signatures retypes en ObjectGuid dans CommandBG et les 5 commandants (WS/AB/EY/AV/IC). Co-Authored-By: Claude Fable 5 --- src/server/game/Battlegrounds/CommandBG.cpp | 27 ++++++++++++------- src/server/game/Battlegrounds/CommandBG.h | 14 +++++----- .../Battlegrounds/CommandBG/CommandAB.cpp | 10 +++---- .../game/Battlegrounds/CommandBG/CommandAB.h | 6 ++--- .../Battlegrounds/CommandBG/CommandAV.cpp | 14 +++++----- .../game/Battlegrounds/CommandBG/CommandAV.h | 6 ++--- .../Battlegrounds/CommandBG/CommandEY.cpp | 10 +++---- .../game/Battlegrounds/CommandBG/CommandEY.h | 6 ++--- .../Battlegrounds/CommandBG/CommandIC.cpp | 10 +++---- .../game/Battlegrounds/CommandBG/CommandIC.h | 6 ++--- .../Battlegrounds/CommandBG/CommandWS.cpp | 8 +++--- .../game/Battlegrounds/CommandBG/CommandWS.h | 8 +++--- 12 files changed, 67 insertions(+), 58 deletions(-) diff --git a/src/server/game/Battlegrounds/CommandBG.cpp b/src/server/game/Battlegrounds/CommandBG.cpp index 66d02b5..d18ef9b 100644 --- a/src/server/game/Battlegrounds/CommandBG.cpp +++ b/src/server/game/Battlegrounds/CommandBG.cpp @@ -53,8 +53,9 @@ void CommandBG::Initialize() void CommandBG::ReadyGame() { + TC_LOG_ERROR("server.worldserver", "BGF-DBG: CommandBG::ReadyGame team=%u etat=%u", uint32(m_TeamID), uint32(m_BGGC)); m_BGGC = BGGameCommand::BGGS_Ready; - //for (uint64 guid : m_PlayerGUIDs) + //for (ObjectGuid guid : m_PlayerGUIDs) //{ // if (UnitAI* pAI = GetPlayerAI(guid)) // { @@ -66,8 +67,9 @@ void CommandBG::ReadyGame() void CommandBG::StartGame() { + TC_LOG_ERROR("server.worldserver", "BGF-DBG: CommandBG::StartGame team=%u etat=%u", uint32(m_TeamID), uint32(m_BGGC)); m_BGGC = BGGameCommand::BGGS_Start; - //for (uint64 guid : m_PlayerGUIDs) + //for (ObjectGuid guid : m_PlayerGUIDs) //{ // if (UnitAI* pAI = GetPlayerAI(guid)) // { @@ -77,7 +79,7 @@ void CommandBG::StartGame() //} } -void CommandBG::OnPlayerDead(uint64 guid) +void CommandBG::OnPlayerDead(ObjectGuid guid) { PlayerStatus::iterator itGUID = m_PlayerGUIDs.find(guid); if (itGUID == m_PlayerGUIDs.end()) @@ -87,6 +89,7 @@ void CommandBG::OnPlayerDead(uint64 guid) bool CommandBG::AddPlayerBot(Player* player, Battleground* pBG) { + TC_LOG_ERROR("server.worldserver", "BGF-DBG: CommandBG::AddPlayerBot %s team=%u etat=%u", player ? player->GetName().c_str() : "null", uint32(m_TeamID), uint32(m_BGGC)); if (!player || !pBG) return false; if (m_PlayerGUIDs.find(player->GetGUID()) != m_PlayerGUIDs.end()) @@ -142,6 +145,12 @@ void CommandBG::RemovePlayerBot(Player* player) void CommandBG::Update(uint32 diff) { + static uint32 s_dbgCount = 0; + if (++s_dbgCount % 97 == 0) + TC_LOG_ERROR("server.worldserver", "BGF-DBG: CmdUpdate this=%p inst=%u team=%u etat=%u model=%u statut=%u bots=%u", + (void*)this, m_pBattleground ? m_pBattleground->GetInstanceID() : 0u, + uint32(m_TeamID), uint32(m_BGGC), uint32(g_CommandModelType), + m_pBattleground ? uint32(m_pBattleground->GetStatus()) : 999u, uint32(m_PlayerGUIDs.size())); if (m_BGGC != BGGS_None) { if (m_BGGC == BGGS_Init) @@ -185,18 +194,18 @@ void CommandBG::Update(uint32 diff) } } -UnitAI* CommandBG::GetPlayerAI(uint64 guid) +UnitAI* CommandBG::GetPlayerAI(ObjectGuid guid) { PlayerStatus::iterator itGUID = m_PlayerGUIDs.find(guid); if (itGUID == m_PlayerGUIDs.end()) return NULL; - Player* player = ObjectAccessor::FindPlayer(ObjectGuid::Create(guid)); + Player* player = ObjectAccessor::FindPlayer(guid); if (!player) return NULL; return player->GetAI(); } -BotBGAI* CommandBG::GetBotBGAI(uint64 guid) +BotBGAI* CommandBG::GetBotBGAI(ObjectGuid guid) { UnitAI* pAI = GetPlayerAI(guid); if (!pAI) @@ -204,12 +213,12 @@ BotBGAI* CommandBG::GetBotBGAI(uint64 guid) return (dynamic_cast(pAI)); } -Player* CommandBG::GetBGPlayer(uint64 guid) +Player* CommandBG::GetBGPlayer(ObjectGuid guid) { PlayerStatus::iterator itGUID = m_PlayerGUIDs.find(guid); if (itGUID == m_PlayerGUIDs.end()) return NULL; - return ObjectAccessor::FindPlayer(ObjectGuid::Create(guid)); + return ObjectAccessor::FindPlayer(guid); } Position CommandBG::GetNearTeleportPoint(Position& currentPos) @@ -290,7 +299,7 @@ void CommandBG::ProcessGroupFocus(AIWaypoint* selfFocus, AIWaypoint* enemyFocus) } } -Position CommandBG::GetPositionByGuid(uint64 guid) +Position CommandBG::GetPositionByGuid(ObjectGuid guid) { ObjectGuid oGuid = ObjectGuid::Create(guid); if (oGuid.IsPlayer()) diff --git a/src/server/game/Battlegrounds/CommandBG.h b/src/server/game/Battlegrounds/CommandBG.h index 3adcaf8..b1d0713 100644 --- a/src/server/game/Battlegrounds/CommandBG.h +++ b/src/server/game/Battlegrounds/CommandBG.h @@ -32,8 +32,8 @@ class BotBGAI; typedef std::vector AIWPEntrys; typedef std::vector BGKeyPoints; -typedef std::set PlayerGUIDs; -typedef std::map PlayerStatus; +typedef std::set PlayerGUIDs; +typedef std::map PlayerStatus; enum CommandModel { @@ -101,7 +101,7 @@ public: virtual void Initialize(); virtual void ReadyGame(); virtual void StartGame(); - virtual void OnPlayerDead(uint64 guid); + virtual void OnPlayerDead(ObjectGuid guid); virtual bool AddPlayerBot(Player* player, Battleground* pBG); void RemovePlayerBot(Player* player); virtual AIWaypoint* GetReadyPosition() { return NULL; } @@ -111,9 +111,9 @@ public: virtual bool CanUpMount(Player* player) { return true; } virtual bool CanDireFlee() { return true; } - UnitAI* GetPlayerAI(uint64 guid); - BotBGAI* GetBotBGAI(uint64 guid); - Player* GetBGPlayer(uint64 guid); + UnitAI* GetPlayerAI(ObjectGuid guid); + BotBGAI* GetBotBGAI(ObjectGuid guid); + Player* GetBGPlayer(ObjectGuid guid); Position GetNearTeleportPoint(Position& currentPos); void UpdateBelongBattleground(Battleground* pBG) { m_pBattleground = pBG; } void ClearPlayerGUIDs() { m_PlayerGUIDs.clear(); } @@ -122,7 +122,7 @@ protected: bool GroupAllPlayerReadyToWayPoint(AIWaypoint* pKeyPoint); void ProcessGroupFocus(AIWaypoint* selfFocus, AIWaypoint* enemyFocus); - Position GetPositionByGuid(uint64 guid); + Position GetPositionByGuid(ObjectGuid guid); protected: BGGameCommand m_BGGC; diff --git a/src/server/game/Battlegrounds/CommandBG/CommandAB.cpp b/src/server/game/Battlegrounds/CommandBG/CommandAB.cpp index 9bac1be..9063bf9 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandAB.cpp +++ b/src/server/game/Battlegrounds/CommandBG/CommandAB.cpp @@ -191,7 +191,7 @@ void CommandAB::ProcessABNodeRequirement(uint32 abNode, AIWaypoint* waypoint, Pl int32 needCount = int32(enemyCount) + (flagIsOvvupied ? 2 : 4); for (PlayerGUIDs::iterator itGuid = nodeNearPlayers.begin(); itGuid != nodeNearPlayers.end(); itGuid++) { - uint64 guid = *itGuid; + ObjectGuid guid = *itGuid; if (canStealFlag) { if (!AcceptCommandByPlayerGUID(guid, pBGNode->GetGUID())) @@ -208,7 +208,7 @@ void CommandAB::ProcessABNodeRequirement(uint32 abNode, AIWaypoint* waypoint, Pl while (needCount > 0 && !players.empty()) { float minDistance = 99999; - uint64 minGUID = 0; + ObjectGuid minGUID; for (PlayerGUIDs::iterator itGuid = players.begin(); itGuid != players.end(); itGuid++) { Position pos = GetPositionByGuid(*itGuid); @@ -278,7 +278,7 @@ PlayerGUIDs CommandAB::GetABFlagRangePlayerByTeam(uint32 abNode, TeamId team) return existPlayers; } -bool CommandAB::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag /* = false */) +bool CommandAB::AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag /* = false */) { if (!targetAIWP) return false; @@ -289,7 +289,7 @@ bool CommandAB::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, b return true; } -bool CommandAB::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag /* = false */) +bool CommandAB::AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag /* = false */) { if (flagGuid.IsEmpty()) return false; @@ -300,7 +300,7 @@ bool CommandAB::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool return true; } -void CommandAB::TryOccupiedABNode(uint64 guid) +void CommandAB::TryOccupiedABNode(ObjectGuid guid) { Player* player = GetBGPlayer(guid); if (!player || player->HasUnitState(UNIT_STATE_CASTING) || player->IsInCombat()) diff --git a/src/server/game/Battlegrounds/CommandBG/CommandAB.h b/src/server/game/Battlegrounds/CommandBG/CommandAB.h index 02c0691..0c63918 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandAB.h +++ b/src/server/game/Battlegrounds/CommandBG/CommandAB.h @@ -55,9 +55,9 @@ private: void ProcessABNodeRequirement(uint32 abNode, AIWaypoint* waypoint, PlayerGUIDs& players); bool ABFlagIsOccupied(uint32 abNode, TeamId team); PlayerGUIDs GetABFlagRangePlayerByTeam(uint32 abNode, TeamId team); - bool AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag = false); - bool AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag = false); - void TryOccupiedABNode(uint64 guid); + bool AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag = false); + bool AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag = false); + void TryOccupiedABNode(ObjectGuid guid); uint32 GetABNodeIndexByTeam(uint32 index, TeamId team); private: diff --git a/src/server/game/Battlegrounds/CommandBG/CommandAV.cpp b/src/server/game/Battlegrounds/CommandBG/CommandAV.cpp index 5a18a77..253f49f 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandAV.cpp +++ b/src/server/game/Battlegrounds/CommandBG/CommandAV.cpp @@ -365,7 +365,7 @@ void CommandAV::ProcessRequirementByNodeType(BattlegroundAV* pBattlegroundAV, BG uint32 canSteal = (enemyCount == 0) ? 3 : 0; for (PlayerGUIDs::iterator itGuid = selfPlayers.begin(); itGuid != selfPlayers.end(); itGuid++) { - uint64 guid = *itGuid; + ObjectGuid guid = *itGuid; if (canSteal > 0) { if (!AcceptCommandByPlayerGUID(guid, waypoint, true)) @@ -386,7 +386,7 @@ void CommandAV::ProcessRequirementByNodeType(BattlegroundAV* pBattlegroundAV, BG while (needCount > 0 && !allPlayers.empty() && pBGNode) { float minDistance = 99999; - uint64 minGUID = 0; + ObjectGuid minGUID; for (PlayerGUIDs::iterator itGuid = allPlayers.begin(); itGuid != allPlayers.end(); itGuid++) { Position pos = GetPositionByGuid(*itGuid); @@ -421,7 +421,7 @@ void CommandAV::ProcessRequirementByCaptain(BattlegroundAV* pBattlegroundAV, Tea uint32 needCount = enemyCount + 10; for (PlayerGUIDs::iterator itGuid = selfPlayers.begin(); itGuid != selfPlayers.end(); itGuid++) { - uint64 guid = *itGuid; + ObjectGuid guid = *itGuid; if (!AcceptCommandByPlayerGUID(guid, waypoint)) continue; allPlayers.erase(guid); @@ -432,7 +432,7 @@ void CommandAV::ProcessRequirementByCaptain(BattlegroundAV* pBattlegroundAV, Tea while (needCount > 0 && !allPlayers.empty()) { float minDistance = 99999; - uint64 minGUID = 0; + ObjectGuid minGUID; for (PlayerGUIDs::iterator itGuid = allPlayers.begin(); itGuid != allPlayers.end(); itGuid++) { Position pos = GetPositionByGuid(*itGuid); @@ -485,7 +485,7 @@ PlayerGUIDs CommandAV::GetAVCaptainRangePlayerByTeam(BattlegroundAV* pBattlegrou return existPlayers; } -bool CommandAV::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag /* = false */) +bool CommandAV::AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag /* = false */) { if (!targetAIWP) return false; @@ -496,7 +496,7 @@ bool CommandAV::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, b return true; } -bool CommandAV::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag /* = false */) +bool CommandAV::AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag /* = false */) { if (flagGuid.IsEmpty()) return false; @@ -507,7 +507,7 @@ bool CommandAV::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool return true; } -void CommandAV::TryOccupiedAVNode(BattlegroundAV* pBattlegroundAV, uint64 guid) +void CommandAV::TryOccupiedAVNode(BattlegroundAV* pBattlegroundAV, ObjectGuid guid) { Player* player = GetBGPlayer(guid); if (!player || player->HasUnitState(UNIT_STATE_CASTING) || player->IsInCombat()) diff --git a/src/server/game/Battlegrounds/CommandBG/CommandAV.h b/src/server/game/Battlegrounds/CommandBG/CommandAV.h index e69a6d4..997d869 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandAV.h +++ b/src/server/game/Battlegrounds/CommandBG/CommandAV.h @@ -70,9 +70,9 @@ private: void ProcessRequirementByCaptain(BattlegroundAV* pBattlegroundAV, TeamId team, AIWaypoint* waypoint, PlayerGUIDs& allPlayers, bool attOrDef); PlayerGUIDs GetAVFlagRangePlayerByTeam(BattlegroundAV* pBattlegroundAV, BG_AV_Nodes nodeType, TeamId team); PlayerGUIDs GetAVCaptainRangePlayerByTeam(BattlegroundAV* pBattlegroundAV, Creature const* pCaptain, TeamId team); - bool AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag = false); - bool AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag = false); - void TryOccupiedAVNode(BattlegroundAV* pBattlegroundAV, uint64 guid); + bool AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag = false); + bool AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag = false); + void TryOccupiedAVNode(BattlegroundAV* pBattlegroundAV, ObjectGuid guid); private: int32 lastUpdateTick; diff --git a/src/server/game/Battlegrounds/CommandBG/CommandEY.cpp b/src/server/game/Battlegrounds/CommandBG/CommandEY.cpp index 00ea498..5cfd28f 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandEY.cpp +++ b/src/server/game/Battlegrounds/CommandBG/CommandEY.cpp @@ -261,7 +261,7 @@ void CommandEY::ProcessEYPointRequirement(uint32 point, AIWaypoint* waypoint, Pl int32 needCount = int32(enemyCount) + (flagIsOvvupied ? 1 : 3); for (PlayerGUIDs::iterator itGuid = nodeNearPlayers.begin(); itGuid != nodeNearPlayers.end(); itGuid++) { - uint64 guid = *itGuid; + ObjectGuid guid = *itGuid; if (!AcceptCommandByPlayerGUID(guid, waypoint)) continue; players.erase(guid); @@ -272,7 +272,7 @@ void CommandEY::ProcessEYPointRequirement(uint32 point, AIWaypoint* waypoint, Pl while (needCount > 0 && !players.empty()) { float minDistance = 99999; - uint64 minGUID = 0; + ObjectGuid minGUID; for (PlayerGUIDs::iterator itGuid = players.begin(); itGuid != players.end(); itGuid++) { Position pos = GetPositionByGuid(*itGuid); @@ -323,7 +323,7 @@ PlayerGUIDs CommandEY::GetEYPointRangePlayerByTeam(uint32 point, TeamId team) return existPlayers; } -bool CommandEY::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag /* = false */) +bool CommandEY::AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag /* = false */) { if (!targetAIWP) return false; @@ -334,7 +334,7 @@ bool CommandEY::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, b return true; } -bool CommandEY::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag /* = false */) +bool CommandEY::AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag /* = false */) { if (flagGuid.IsEmpty()) return false; @@ -361,7 +361,7 @@ uint32 CommandEY::GetEYPointIndexByTeam(uint32 index, TeamId team) return (team == TEAM_ALLIANCE) ? EYBattlegroundPoints::MAGE_TOWER : EYBattlegroundPoints::BLOOD_ELF; } -void CommandEY::TryPickStormFlag(uint64 guid) +void CommandEY::TryPickStormFlag(ObjectGuid guid) { if (!m_pBattleground) return; diff --git a/src/server/game/Battlegrounds/CommandBG/CommandEY.h b/src/server/game/Battlegrounds/CommandBG/CommandEY.h index 37bc2b2..0fda16d 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandEY.h +++ b/src/server/game/Battlegrounds/CommandBG/CommandEY.h @@ -52,10 +52,10 @@ private: void ProcessEYPointRequirement(uint32 point, AIWaypoint* waypoint, PlayerGUIDs& players); bool EYPointIsOccupied(uint32 point, TeamId team); PlayerGUIDs GetEYPointRangePlayerByTeam(uint32 point, TeamId team); - bool AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag = false); - bool AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag = false); + bool AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag = false); + bool AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag = false); uint32 GetEYPointIndexByTeam(uint32 index, TeamId team); - void TryPickStormFlag(uint64 guid); + void TryPickStormFlag(ObjectGuid guid); void TryCaptureFlag(Player* player, AIWaypoint* pAIWP, uint32 point); void ProcessFlagPicker(Player* player); uint32 GetCaptureFlagPoint(uint32 index, TeamId team); diff --git a/src/server/game/Battlegrounds/CommandBG/CommandIC.cpp b/src/server/game/Battlegrounds/CommandBG/CommandIC.cpp index a737a7e..badecd5 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandIC.cpp +++ b/src/server/game/Battlegrounds/CommandBG/CommandIC.cpp @@ -194,7 +194,7 @@ void CommandIC::ProcessICNodeRequirement(uint32 nodeType, AIWaypoint* waypoint, int32 canStealFlag = (nearEnemyCount == 0 && !flagIsOcupied) ? 1 : 0; for (PlayerGUIDs::iterator itGuid = nodeNearPlayers.begin(); itGuid != nodeNearPlayers.end(); itGuid++) { - uint64 guid = *itGuid; + ObjectGuid guid = *itGuid; if (canStealFlag > 0) { if (!AcceptCommandByPlayerGUID(guid, pBGNode->GetGUID())) @@ -211,7 +211,7 @@ void CommandIC::ProcessICNodeRequirement(uint32 nodeType, AIWaypoint* waypoint, while (needCount > 0 && !players.empty()) { float minDistance = 99999; - uint64 minGUID = 0; + ObjectGuid minGUID; for (PlayerGUIDs::iterator itGuid = players.begin(); itGuid != players.end(); itGuid++) { Position pos = GetPositionByGuid(*itGuid); @@ -258,7 +258,7 @@ PlayerGUIDs CommandIC::GetICFlagRangePlayerByTeam(uint32 nodeType, TeamId team, return existPlayers; } -bool CommandIC::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag /* = false */) +bool CommandIC::AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag /* = false */) { if (!targetAIWP) return false; @@ -269,7 +269,7 @@ bool CommandIC::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, b return true; } -bool CommandIC::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag /* = false */) +bool CommandIC::AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag /* = false */) { if (flagGuid.IsEmpty()) return false; @@ -280,7 +280,7 @@ bool CommandIC::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool return true; } -void CommandIC::TryOccupiedICNode(uint64 guid) +void CommandIC::TryOccupiedICNode(ObjectGuid guid) { Player* player = GetBGPlayer(guid); if (!player || player->HasUnitState(UNIT_STATE_CASTING))// || player->IsInCombat()) diff --git a/src/server/game/Battlegrounds/CommandBG/CommandIC.h b/src/server/game/Battlegrounds/CommandBG/CommandIC.h index 623f4c9..975c01e 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandIC.h +++ b/src/server/game/Battlegrounds/CommandBG/CommandIC.h @@ -54,9 +54,9 @@ private: private: void ProcessICNodeRequirement(uint32 nodeType, AIWaypoint* waypoint, uint32 baseCount, PlayerGUIDs& players); PlayerGUIDs GetICFlagRangePlayerByTeam(uint32 nodeType, TeamId team, float range = 40); - bool AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag = false); - bool AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag = false); - void TryOccupiedICNode(uint64 guid); + bool AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag = false); + bool AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag = false); + void TryOccupiedICNode(ObjectGuid guid); uint32 GetICNodeObjectType(uint32 index, TeamId team); private: diff --git a/src/server/game/Battlegrounds/CommandBG/CommandWS.cpp b/src/server/game/Battlegrounds/CommandBG/CommandWS.cpp index 62a5812..8f343e2 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandWS.cpp +++ b/src/server/game/Battlegrounds/CommandBG/CommandWS.cpp @@ -185,7 +185,7 @@ void CommandWS::ProcessRegulation() } } -void CommandWS::TryPickEnemyFlag(uint64 guid) +void CommandWS::TryPickEnemyFlag(ObjectGuid guid) { if (!m_pBattleground) return; @@ -225,7 +225,7 @@ void CommandWS::TryPickEnemyFlag(uint64 guid) pObject->Use(player); } -void CommandWS::TryPickSelfFlag(uint64 guid) +void CommandWS::TryPickSelfFlag(ObjectGuid guid) { if (!m_pBattleground) return; @@ -254,7 +254,7 @@ void CommandWS::TryPickSelfFlag(uint64 guid) pObject->Use(player); } -void CommandWS::TryCaptureFlag(uint64 guid) +void CommandWS::TryCaptureFlag(ObjectGuid guid) { if (!m_pBattleground) return; @@ -593,7 +593,7 @@ ObjectGuid CommandWS::GetBGFlagFromEnemy() return ObjectGuid::Empty; } -GameObject* CommandWS::SearchDropedFlag(uint64 guid, TeamId team) +GameObject* CommandWS::SearchDropedFlag(ObjectGuid guid, TeamId team) { BotBGAI* pBotAI = GetBotBGAI(guid); if (!pBotAI) diff --git a/src/server/game/Battlegrounds/CommandBG/CommandWS.h b/src/server/game/Battlegrounds/CommandBG/CommandWS.h index 345a54e..d1aab4d 100644 --- a/src/server/game/Battlegrounds/CommandBG/CommandWS.h +++ b/src/server/game/Battlegrounds/CommandBG/CommandWS.h @@ -54,15 +54,15 @@ private: void ProcessAllAttack(ObjectGuid& attackGuid); void ProcessAttackAndGuard(ObjectGuid attackGuid, ObjectGuid guaredGuid); - void TryPickEnemyFlag(uint64 guid); - void TryPickSelfFlag(uint64 guid); - void TryCaptureFlag(uint64 guid); + void TryPickEnemyFlag(ObjectGuid guid); + void TryPickSelfFlag(ObjectGuid guid); + void TryCaptureFlag(ObjectGuid guid); ObjectGuid SelfBGFlagPicker(); ObjectGuid EnemyBGFlagPicker(); ObjectGuid GetBGFlagFromSelf(); ObjectGuid GetBGFlagFromEnemy(); - GameObject* SearchDropedFlag(uint64 guid, TeamId team); + GameObject* SearchDropedFlag(ObjectGuid guid, TeamId team); private: int32 lastUpdateTick;