fix(Core/Arenas): correct BG status on Arena leave (#7323)
- Closes #7278
This commit is contained in:
@@ -1105,6 +1105,9 @@ void Battleground::RemovePlayerAtLeave(Player* player)
|
|||||||
|
|
||||||
player->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
player->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
||||||
|
|
||||||
|
// GetStatus might be changed in RemovePlayer - define it here
|
||||||
|
BattlegroundStatus status = GetStatus();
|
||||||
|
|
||||||
// BG subclass specific code
|
// BG subclass specific code
|
||||||
RemovePlayer(player);
|
RemovePlayer(player);
|
||||||
|
|
||||||
@@ -1116,7 +1119,7 @@ void Battleground::RemovePlayerAtLeave(Player* player)
|
|||||||
player->ClearAfkReports();
|
player->ClearAfkReports();
|
||||||
|
|
||||||
//left a rated match in progress, consider as loser
|
//left a rated match in progress, consider as loser
|
||||||
if (isArena() && isRated() && GetStatus() == STATUS_IN_PROGRESS && teamId != TEAM_NEUTRAL)
|
if (isArena() && isRated() && status == STATUS_IN_PROGRESS && teamId != TEAM_NEUTRAL)
|
||||||
{
|
{
|
||||||
ArenaTeam* winnerArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeamId(teamId)));
|
ArenaTeam* winnerArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeamId(teamId)));
|
||||||
ArenaTeam* loserArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(teamId));
|
ArenaTeam* loserArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(teamId));
|
||||||
@@ -1139,7 +1142,7 @@ void Battleground::RemovePlayerAtLeave(Player* player)
|
|||||||
|
|
||||||
// cast deserter
|
// cast deserter
|
||||||
if (isBattleground() && !player->IsGameMaster() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
|
if (isBattleground() && !player->IsGameMaster() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
|
||||||
if (GetStatus() == STATUS_IN_PROGRESS || GetStatus() == STATUS_WAIT_JOIN)
|
if (status == STATUS_IN_PROGRESS || status == STATUS_WAIT_JOIN)
|
||||||
player->ScheduleDelayedOperation(DELAYED_SPELL_CAST_DESERTER);
|
player->ScheduleDelayedOperation(DELAYED_SPELL_CAST_DESERTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user