aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2015-08-26 22:59:03 +0200
committerjackpoz <giacomopoz@gmail.com>2015-08-26 22:59:03 +0200
commitc67118f909fee1ed489e3125cb85f3a8179c1a43 (patch)
tree574fac2b01f738cb04e50d2e01677e3a8a0a3796 /src
parent562e82928f3a57c60bcace69ca73246afc0f1805 (diff)
Core/Battleground: Fix issue reported by static analysis
Coverity defect IDs: 1193415
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 8e5766407f1..5bdaf0e661d 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -821,7 +821,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);
}