aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShocker <shocker@freakz.ro>2011-06-17 21:26:33 +0300
committerShocker <shocker@freakz.ro>2011-06-17 21:26:33 +0300
commitf2735b85c7a3e311b1feea3856cc8e4871a05e7f (patch)
tree85c788f9f34a8030641ec08468a3f0568a88686b
parentb1bde4d01f0a0d03168e8fa32da8f8aadb4d276b (diff)
Core/Battlegrounds: Remove player on leave from battleground player map only after battleground-specific code
-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();