new BattlegroundDesertionTypes for hook OnBattlegroundDesertion (#20039)

* new BattlegroundDesertionTypes for hook OnBattlegroundDesertion

* chore: minor improvements

---------

Co-authored-by: laasker <79991768+laasker@users.noreply.github.com>
This commit is contained in:
Stefano Borzì
2024-09-27 22:19:56 +02:00
committed by GitHub
parent d8221088f5
commit f6de601ddd
5 changed files with 21 additions and 5 deletions

View File

@@ -637,6 +637,9 @@ void WorldSession::LogoutPlayer(bool save)
sScriptMgr->OnBattlegroundDesertion(_player, BG_DESERTION_TYPE_INVITE_LOGOUT);
}
if (bgQueueTypeId >= BATTLEGROUND_QUEUE_2v2 && bgQueueTypeId < MAX_BATTLEGROUND_QUEUE_TYPES && _player->IsInvitedForBattlegroundQueueType(bgQueueTypeId))
sScriptMgr->OnBattlegroundDesertion(_player, ARENA_DESERTION_TYPE_INVITE_LOGOUT);
_player->RemoveBattlegroundQueueId(bgQueueTypeId);
sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId).RemovePlayer(_player->GetGUID(), true);
}