feat(Battlegrounds): make it compatible with custom arena type (#18679)
* feat(Battlegrounds): make it compatible with custom arena type * fix(BattlegroundQueue.cpp): ignore bg for arena condition * feat(Scripting): add OnQueueUpdateValidity hook * fix: codestyle
This commit is contained in:
parent
cf95c1dfbd
commit
0dd5c6e3b4
5 changed files with 17 additions and 1 deletions
|
|
@ -54,6 +54,11 @@ void ScriptMgr::OnQueueUpdate(BattlegroundQueue* queue, uint32 diff, Battlegroun
|
|||
CALL_ENABLED_HOOKS(AllBattlegroundScript, ALLBATTLEGROUNDHOOK_ON_QUEUE_UPDATE, script->OnQueueUpdate(queue, diff, bgTypeId, bracket_id, arenaType, isRated, arenaRating));
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQueueUpdateValidity(BattlegroundQueue* queue, uint32 diff, BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id, uint8 arenaType, bool isRated, uint32 arenaRating)
|
||||
{
|
||||
CALL_ENABLED_BOOLEAN_HOOKS(AllBattlegroundScript, ALLBATTLEGROUNDHOOK_ON_QUEUE_UPDATE_VALIDITY, !script->OnQueueUpdateValidity(queue, diff, bgTypeId, bracket_id, arenaType, isRated, arenaRating));
|
||||
}
|
||||
|
||||
void ScriptMgr::OnAddGroup(BattlegroundQueue* queue, GroupQueueInfo* ginfo, uint32& index, Player* leader, Group* group, BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated, bool isPremade, uint32 arenaRating, uint32 matchmakerRating, uint32 arenaTeamId, uint32 opponentsArenaTeamId)
|
||||
{
|
||||
CALL_ENABLED_HOOKS(AllBattlegroundScript, ALLBATTLEGROUNDHOOK_ON_ADD_GROUP, script->OnAddGroup(queue, ginfo, index, leader, group, bgTypeId, bracketEntry, arenaType, isRated, isPremade, arenaRating, matchmakerRating, arenaTeamId, opponentsArenaTeamId));
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ enum AllBattlegroundHook
|
|||
ALLBATTLEGROUNDHOOK_ON_BATTLEGROUND_BEFORE_ADD_PLAYER,
|
||||
ALLBATTLEGROUNDHOOK_ON_BATTLEGROUND_REMOVE_PLAYER_AT_LEAVE,
|
||||
ALLBATTLEGROUNDHOOK_ON_QUEUE_UPDATE,
|
||||
ALLBATTLEGROUNDHOOK_ON_QUEUE_UPDATE_VALIDITY,
|
||||
ALLBATTLEGROUNDHOOK_ON_ADD_GROUP,
|
||||
ALLBATTLEGROUNDHOOK_CAN_FILL_PLAYERS_TO_BG,
|
||||
ALLBATTLEGROUNDHOOK_IS_CHECK_NORMAL_MATCH,
|
||||
|
|
@ -78,6 +79,8 @@ public:
|
|||
|
||||
virtual void OnQueueUpdate(BattlegroundQueue* /*queue*/, uint32 /* diff */, BattlegroundTypeId /* bgTypeId */, BattlegroundBracketId /* bracket_id */, uint8 /* arenaType */, bool /* isRated */, uint32 /* arenaRating */) { }
|
||||
|
||||
[[nodiscard]] virtual bool OnQueueUpdateValidity(BattlegroundQueue* /*queue*/, uint32 /* diff */, BattlegroundTypeId /* bgTypeId */, BattlegroundBracketId /* bracket_id */, uint8 /* arenaType */, bool /* isRated */, uint32 /* arenaRating */) { return true; }
|
||||
|
||||
virtual void OnAddGroup(BattlegroundQueue* /*queue*/, GroupQueueInfo* /*ginfo*/, uint32& /*index*/, Player* /*leader*/, Group* /*group*/, BattlegroundTypeId /* bgTypeId */, PvPDifficultyEntry const* /* bracketEntry */,
|
||||
uint8 /* arenaType */, bool /* isRated */, bool /* isPremade */, uint32 /* arenaRating */, uint32 /* matchmakerRating */, uint32 /* arenaTeamId */, uint32 /* opponentsArenaTeamId */) { }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue