diff options
-rw-r--r-- | src/game/DBCStores.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index eed2e2c8a50..322ffca5d20 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -22,6 +22,7 @@ #include "Policies/SingletonImp.h" #include "Log.h" #include "ProgressBar.h" +#include "SharedDefines.h" #include "DBCfmt.h" @@ -393,9 +394,13 @@ void LoadDBCStores(const std::string& dataPath) if(!talentTabInfo) continue; + // prevent memory corruption; otherwise cls will become 12 below + if (! talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE) + continue; + // store class talent tab pages uint32 cls = 1; - for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < 12 /*MAX_CLASSES*/;m <<=1, ++cls) {} + for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES;m <<=1, ++cls) {} sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId; |