aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiberate <none@none>2010-09-12 17:48:50 +0200
committerLiberate <none@none>2010-09-12 17:48:50 +0200
commitc5b1861fe9dfe9fd94aa006a7e27f72b32899105 (patch)
tree297dc7991113d084b8dd38163efc674bd45a3ede
parente8732898284a66077abeba33f62abf982bf06fd6 (diff)
Core/Arena: Fixes a bug/exploit that makes you able to join arena with offline team mates.
Fixes issue #3504 --HG-- branch : trunk
-rw-r--r--src/server/game/Groups/Group.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index a01972fee66..6fa49fd3fb4 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1607,10 +1607,6 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
// check for min / max count
uint32 memberscount = GetMembersCount();
- // only check for MinPlayerCount since MinPlayerCount == MaxPlayerCount for arenas...
- if (bgOrTemplate->isArena() && memberscount != MinPlayerCount)
- return ERR_ARENA_TEAM_PARTY_SIZE;
-
if (memberscount > bgEntry->maxGroupSize) // no MinPlayerCount for battlegrounds
return ERR_BATTLEGROUND_NONE; // ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY handled on client side
@@ -1630,7 +1626,8 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
BattlegroundQueueTypeId bgQueueTypeIdRandom = BattlegroundMgr::BGQueueTypeId(BATTLEGROUND_RB, 0);
// check every member of the group to be able to join
- for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ memberscount = 1;
+ for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next(), ++memberscount)
{
Player *member = itr->getSource();
// offline member? don't let join
@@ -1662,6 +1659,11 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
if (!member->HasFreeBattlegroundQueueId())
return ERR_BATTLEGROUND_TOO_MANY_QUEUES; // not blizz-like
}
+
+ // only check for MinPlayerCount since MinPlayerCount == MaxPlayerCount for arenas...
+ if (bgOrTemplate->isArena() && memberscount != MinPlayerCount)
+ return ERR_ARENA_TEAM_PARTY_SIZE;
+
return GroupJoinBattlegroundResult(bgOrTemplate->GetTypeID());
}