diff options
author | Shauren <shauren.trinity@gmail.com> | 2022-04-14 23:31:17 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-04-16 12:15:37 +0200 |
commit | 84486ded67efc4e779412ff865c66ca8b9cee7ea (patch) | |
tree | a151ddae81c40c305f9540689ae9778d21b81d5b /src/server/game/Battlegrounds/BattlegroundQueue.cpp | |
parent | 15fe4e09d4dda16f23100412670dbdfbae5c5e61 (diff) |
Core/Battlegrounds: Store mercenary status separately from the aura obtained from gossip as it can be removed at any time
Diffstat (limited to 'src/server/game/Battlegrounds/BattlegroundQueue.cpp')
-rw-r--r-- | src/server/game/Battlegrounds/BattlegroundQueue.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 10b10f805ee..103281c51fd 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -130,7 +130,7 @@ bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo* ginfo, uint32 de /*********************************************************/ // add group or player (grp == NULL) to bg queue with the given leader and bg specifications -GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, PVPDifficultyEntry const* bracketEntry, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid) +GroupQueueInfo* BattlegroundQueue::AddGroup(Player const* leader, Group const* group, Team team, PVPDifficultyEntry const* bracketEntry, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid) { BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); @@ -140,7 +140,7 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, PVPDiffi ginfo->IsInvitedToBGInstanceGUID = 0; ginfo->JoinTime = GameTime::GetGameTimeMS(); ginfo->RemoveInviteTime = 0; - ginfo->Team = leader->GetBgQueueTeam(); + ginfo->Team = team; ginfo->ArenaTeamRating = ArenaRating; ginfo->ArenaMatchmakerRating = MatchmakerRating; ginfo->OpponentsTeamRating = 0; @@ -167,9 +167,9 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, PVPDiffi } //add players from group to ginfo - if (grp) + if (group) { - for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next()) + for (GroupReference const* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) { Player* member = itr->GetSource(); if (!member) @@ -179,14 +179,6 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, PVPDiffi pl_info.GroupInfo = ginfo; // add the pinfo to ginfo's list ginfo->Players[member->GetGUID()] = &pl_info; - - if (ginfo->Team != member->GetTeam()) - { - if (member->GetTeam() == ALLIANCE) - member->CastSpell(member, SPELL_MERCENARY_CONTRACT_HORDE); - else - member->CastSpell(member, SPELL_MERCENARY_CONTRACT_ALLIANCE); - } } } else |