mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user