Core/DataStores: Fixed out of bounds array access during loading TaxiNodes.db2 and added ASSERT for TaxiMaskSize for future versions

This commit is contained in:
Shauren
2015-03-08 01:29:34 +01:00
parent 8cd1c9514f
commit ce35bfe113
2 changed files with 5 additions and 1 deletions

View File

@@ -225,6 +225,10 @@ void DB2Manager::LoadStores(std::string const& dataPath)
// Initialize global taxinodes mask
// include existed nodes that have at least single not spell base (scripted) path
{
ASSERT(TaxiMaskSize >= ((sTaxiNodesStore.GetNumRows() - 1) / 8) + 1,
"TaxiMaskSize is not large enough to contain all taxi nodes! (current value %d, required %d)",
TaxiMaskSize, (((sTaxiNodesStore.GetNumRows() - 1) / 8) + 1));
std::set<uint32> spellPaths;
for (SpellEffectEntry const* sInfo : sSpellEffectStore)
if (sInfo->Effect == SPELL_EFFECT_SEND_TAXI)

View File

@@ -495,7 +495,7 @@ struct TaxiPathNodePtr
typedef Path<TaxiPathNodePtr, TaxiPathNodeEntry const> TaxiPathNodeList;
typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath;
#define TaxiMaskSize 114
#define TaxiMaskSize 201
typedef uint8 TaxiMask[TaxiMaskSize];
#endif