mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
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);
|
||||
|
||||
// GetStatus might be changed in RemovePlayer - define it here
|
||||
BattlegroundStatus status = GetStatus();
|
||||
|
||||
// BG subclass specific code
|
||||
RemovePlayer(player);
|
||||
|
||||
@@ -1116,7 +1119,7 @@ void Battleground::RemovePlayerAtLeave(Player* player)
|
||||
player->ClearAfkReports();
|
||||
|
||||
//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* loserArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(teamId));
|
||||
@@ -1139,7 +1142,7 @@ void Battleground::RemovePlayerAtLeave(Player* player)
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user