mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Collision: Fix crash when loading invalid vmap data
Fix array overflow when loading Models from vmap tiles with wrong/outdated/bad data.
Try extracting again vmaps if you see this error.
Closes #14255
(cherry picked from commit 3035a4218b)
This commit is contained in:
@@ -386,13 +386,12 @@ namespace VMAP
|
||||
{
|
||||
if (!iLoadedSpawns.count(referencedVal))
|
||||
{
|
||||
#ifdef VMAP_DEBUG
|
||||
if (referencedVal > iNTreeValues)
|
||||
{
|
||||
TC_LOG_DEBUG("maps", "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues);
|
||||
VMAP_ERROR_LOG("maps", "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u) referenced in tile %s", referencedVal, iNTreeValues, tilefile.c_str());
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
iTreeValues[referencedVal] = ModelInstance(spawn, model);
|
||||
iLoadedSpawns[referencedVal] = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user