aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index b382735d3ef..133749fedd5 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -873,16 +873,6 @@ void Battleground::BlockMovement(Player* plr)
void Battleground::RemovePlayerAtLeave(const uint64& guid, bool Transport, bool SendPacket)
{
uint32 team = GetPlayerTeam(guid);
- bool participant = false;
- // Remove from lists/maps
- BattlegroundPlayerMap::iterator itr = m_Players.find(guid);
- if (itr != m_Players.end())
- {
- UpdatePlayersCountByTeam(team, true); // -1 player
- m_Players.erase(itr);
- // check if the player was a participant of the match, or only entered through gm command (goname)
- participant = true;
- }
BattlegroundScoreMap::iterator itr2 = m_PlayerScores.find(guid);
if (itr2 != m_PlayerScores.end())
@@ -907,6 +897,17 @@ void Battleground::RemovePlayerAtLeave(const uint64& guid, bool Transport, bool
RemovePlayer(plr, guid); // BG subclass specific code
+ bool participant = false;
+ // Remove from lists/maps
+ BattlegroundPlayerMap::iterator itr = m_Players.find(guid);
+ if (itr != m_Players.end())
+ {
+ UpdatePlayersCountByTeam(team, true); // -1 player
+ m_Players.erase(itr);
+ // check if the player was a participant of the match, or only entered through gm command (goname)
+ participant = true;
+ }
+
if (participant) // if the player was a match participant, remove auras, calc rating, update queue
{
BattlegroundTypeId bgTypeId = GetTypeID();