Core/Battlegrounds: Remove player on leave from battleground player map only after battleground-specific code
This commit is contained in:
@@ -873,16 +873,6 @@ void Battleground::BlockMovement(Player* plr)
|
|||||||
void Battleground::RemovePlayerAtLeave(const uint64& guid, bool Transport, bool SendPacket)
|
void Battleground::RemovePlayerAtLeave(const uint64& guid, bool Transport, bool SendPacket)
|
||||||
{
|
{
|
||||||
uint32 team = GetPlayerTeam(guid);
|
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);
|
BattlegroundScoreMap::iterator itr2 = m_PlayerScores.find(guid);
|
||||||
if (itr2 != m_PlayerScores.end())
|
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
|
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
|
if (participant) // if the player was a match participant, remove auras, calc rating, update queue
|
||||||
{
|
{
|
||||||
BattlegroundTypeId bgTypeId = GetTypeID();
|
BattlegroundTypeId bgTypeId = GetTypeID();
|
||||||
|
|||||||
Reference in New Issue
Block a user