aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2015-08-26 22:59:03 +0200
committerCarbenium <carbenium@outlook.com>2015-09-24 23:25:28 +0200
commitd0ce95fca5d3661a35ae500f3c57f676e459a926 (patch)
treeb9474c952697b8841df7835e790fc6df92e1b862 /src
parent93e77bfc7b94d4e3505189d614a7da90877f166d (diff)
Core/Battleground: Fix issue reported by static analysis
Coverity defect IDs: 1193415 (cherry picked from commit c67118f909fee1ed489e3125cb85f3a8179c1a43)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index bbd7acacf12..74a9ac32b1b 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -716,7 +716,8 @@ void BattlegroundMgr::ToggleArenaTesting()
void BattlegroundMgr::SetHolidayWeekends(uint32 mask)
{
- for (uint32 bgtype = 1; bgtype < MAX_BATTLEGROUND_TYPE_ID; ++bgtype)
+ // The current code supports battlegrounds up to BattlegroundTypeId(31)
+ for (uint32 bgtype = 1; bgtype < MAX_BATTLEGROUND_TYPE_ID && bgtype < 32; ++bgtype)
if (Battleground* bg = GetBattlegroundTemplate(BattlegroundTypeId(bgtype)))
bg->SetHoliday((mask & (1 << bgtype)) != 0);
}