Skip to content

Commit 96bd126

Browse files
committed
Core/Groups: Use full guid for battleground score storage
(cherry picked from commit 1ac720f)
1 parent f2a390e commit 96bd126

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

src/server/game/Battlegrounds/Arena.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void Arena::AddPlayer(Player* player)
6060
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
6161
Battleground::AddPlayer(player);
6262
if (!isInBattleground)
63-
PlayerScores[player->GetGUID().GetCounter()] = new ArenaScore(player->GetGUID(), player->GetBGTeam());
63+
PlayerScores[player->GetGUID()] = new ArenaScore(player->GetGUID(), player->GetBGTeam());
6464

6565
if (player->GetBGTeam() == ALLIANCE) // gold
6666
{
@@ -201,7 +201,7 @@ void Arena::EndBattleground(uint32 winner)
201201

202202
if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO))
203203
for (auto const& score : PlayerScores)
204-
if (Player* player = ObjectAccessor::FindConnectedPlayer(ObjectGuid(HighGuid::Player, score.first)))
204+
if (Player* player = ObjectAccessor::FindConnectedPlayer(score.first))
205205
{
206206
TC_LOG_DEBUG("bg.arena", "Statistics match Type: {} for {} (GUID: {}, Team: {}, IP: {}): {}",
207207
GetArenaType(), player->GetName(), score.first, player->GetArenaTeamId(GetArenaType() == 5 ? 2 : GetArenaType() == 3),

src/server/game/Battlegrounds/Battleground.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ void Battleground::EndBattleground(uint32 winner)
759759
if (isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE))
760760
{
761761
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PVPSTATS_PLAYER);
762-
BattlegroundScoreMap::const_iterator score = PlayerScores.find(player->GetGUID().GetCounter());
762+
BattlegroundScoreMap::const_iterator score = PlayerScores.find(player->GetGUID());
763763

764764
stmt->setUInt32(0, battlegroundId);
765765
stmt->setUInt32(1, player->GetGUID().GetCounter());
@@ -845,7 +845,7 @@ void Battleground::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
845845
participant = true;
846846
}
847847

848-
BattlegroundScoreMap::iterator itr2 = PlayerScores.find(guid.GetCounter());
848+
BattlegroundScoreMap::iterator itr2 = PlayerScores.find(guid);
849849
if (itr2 != PlayerScores.end())
850850
{
851851
delete itr2->second; // delete player's score
@@ -1242,7 +1242,7 @@ void Battleground::BuildPvPLogDataPacket(WorldPackets::Battleground::PVPMatchSta
12421242

12431243
bool Battleground::UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor)
12441244
{
1245-
BattlegroundScoreMap::const_iterator itr = PlayerScores.find(player->GetGUID().GetCounter());
1245+
BattlegroundScoreMap::const_iterator itr = PlayerScores.find(player->GetGUID());
12461246
if (itr == PlayerScores.end()) // player not found...
12471247
return false;
12481248

src/server/game/Battlegrounds/Battleground.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ class TC_GAME_API Battleground
343343
BattlegroundPlayerMap const& GetPlayers() const { return m_Players; }
344344
uint32 GetPlayersSize() const { return m_Players.size(); }
345345

346-
typedef std::map<uint32, BattlegroundScore*> BattlegroundScoreMap;
346+
typedef std::map<ObjectGuid, BattlegroundScore*> BattlegroundScoreMap;
347347
uint32 GetPlayerScoresSize() const { return PlayerScores.size(); }
348348

349349
uint32 GetReviveQueueSize() const { return m_ReviveQueue.size(); }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void BattlegroundAB::AddPlayer(Player* player)
231231
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
232232
Battleground::AddPlayer(player);
233233
if (!isInBattleground)
234-
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundABScore(player->GetGUID());
234+
PlayerScores[player->GetGUID()] = new BattlegroundABScore(player->GetGUID());
235235
}
236236

237237
void BattlegroundAB::RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ void BattlegroundAV::AddPlayer(Player* player)
444444
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
445445
Battleground::AddPlayer(player);
446446
if (!isInBattleground)
447-
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundAVScore(player->GetGUID());
447+
PlayerScores[player->GetGUID()] = new BattlegroundAVScore(player->GetGUID());
448448
}
449449

450450
void BattlegroundAV::EndBattleground(uint32 winner)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void BattlegroundEY::AddPlayer(Player* player)
360360
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
361361
Battleground::AddPlayer(player);
362362
if (!isInBattleground)
363-
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundEYScore(player->GetGUID());
363+
PlayerScores[player->GetGUID()] = new BattlegroundEYScore(player->GetGUID());
364364

365365
m_PlayersNearPoint[EY_POINTS_MAX].push_back(player->GetGUID());
366366
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void BattlegroundIC::AddPlayer(Player* player)
249249
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
250250
Battleground::AddPlayer(player);
251251
if (!isInBattleground)
252-
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundICScore(player->GetGUID());
252+
PlayerScores[player->GetGUID()] = new BattlegroundICScore(player->GetGUID());
253253

254254
if (nodePoint[NODE_TYPE_QUARRY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
255255
player->CastSpell(player, SPELL_QUARRY, true);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ void BattlegroundSA::AddPlayer(Player* player)
483483
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
484484
Battleground::AddPlayer(player);
485485
if (!isInBattleground)
486-
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundSAScore(player->GetGUID());
486+
PlayerScores[player->GetGUID()] = new BattlegroundSAScore(player->GetGUID());
487487

488488
SendTransportInit(player);
489489

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ void BattlegroundWS::AddPlayer(Player* player)
243243
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
244244
Battleground::AddPlayer(player);
245245
if (!isInBattleground)
246-
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundWGScore(player->GetGUID());
246+
PlayerScores[player->GetGUID()] = new BattlegroundWGScore(player->GetGUID());
247247
}
248248

249249
void BattlegroundWS::RespawnFlag(uint32 Team, bool captured)

0 commit comments

Comments
 (0)