Core/Battlegrounds: Remove player on leave from battleground player map only after battleground-specific code

This commit is contained in:
Shocker
2011-06-17 21:26:33 +03:00
parent b1bde4d01f
commit f2735b85c7
+11 -10
View File
@@ -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();