aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2015-10-13 21:18:30 +0200
committerNaios <naios-dev@live.de>2015-10-13 21:18:30 +0200
commit5a71eb73848b39af19b266f0a063798c7c85b7e2 (patch)
treec7a71ee3bb4654e817515daeacaed66244c7f421 /src
parent3f29ce9e8f7c9c57eacf38493737b5a7bce39925 (diff)
parentb76ea116851bae7084d36091fa1fa430de9b5dda (diff)
Merge pull request #15711 from ShinDarth/bg-leave
Core/BG: Improved Battleground.InvitationType = 2
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Battlegrounds/BattlegroundQueue.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index 6fd25246690..162122ab4db 100644
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -503,19 +503,25 @@ void BattlegroundQueue::FillPlayersToBG(Battleground* bg, BattlegroundBracketId
// try to get even teams
if (sWorld->getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == BG_QUEUE_INVITATION_TYPE_EVEN)
{
- int32 hordeExtra = hordeCount - aliCount;
- int32 aliExtra = aliCount - hordeCount;
+ // check if the teams are even
+ if (hordeFree == 1 && aliFree == 1)
+ {
+ // if we are here, the teams have the same amount of players
+ // then we have to allow to join the same amount of players
+ int32 hordeExtra = hordeCount - aliCount;
+ int32 aliExtra = aliCount - hordeCount;
- hordeExtra = std::max(hordeExtra, 0);
- aliExtra = std::max(aliExtra, 0);
+ hordeExtra = std::max(hordeExtra, 0);
+ aliExtra = std::max(aliExtra, 0);
- if (aliCount != hordeCount)
- {
- aliFree -= aliExtra;
- hordeFree -= hordeExtra;
+ if (aliCount != hordeCount)
+ {
+ aliFree -= aliExtra;
+ hordeFree -= hordeExtra;
- aliFree = std::max(aliFree, 0);
- hordeFree = std::max(hordeFree, 0);
+ aliFree = std::max(aliFree, 0);
+ hordeFree = std::max(hordeFree, 0);
+ }
}
}