diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Battlegrounds/Battleground.cpp | 7 | ||||
-rw-r--r-- | src/server/game/Battlegrounds/Battleground.h | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 6f6d1b66308..f2a112cbeba 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -738,7 +738,7 @@ void Battleground::EndBattleground(uint32 winner) stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PVPSTATS_BATTLEGROUND); stmt->setUInt64(0, battlegroundId); stmt->setUInt8(1, GetWinner()); - stmt->setUInt8(2, m_BracketId + 1); + stmt->setUInt8(2, GetUniqueBracketId()); stmt->setUInt8(3, GetTypeID(true)); CharacterDatabase.Execute(stmt); } @@ -1832,3 +1832,8 @@ bool Battleground::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* TC_LOG_ERROR("bg.battleground", "Battleground::CheckAchievementCriteriaMeet: No implementation for criteria %u", criteriaId); return false; } + +uint8 Battleground::GetUniqueBracketId() const +{ + return GetMinLevel() / 10; +} diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index b0270192fd1..b14c18c9335 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -469,6 +469,9 @@ class Battleground virtual uint32 GetPrematureWinner(); + // because BattleGrounds with different types and same level range has different m_BracketId + uint8 GetUniqueBracketId() const; + protected: // this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground void EndNow(); |