Core/Vmaps: Fixed use after free and deadlocks when loading a model file fails

Port From (https://github.com/TrinityCore/TrinityCore/commit/d05dbaaecbd4bf7e1c0fd32d0fef34341b4067f6)
This commit is contained in:
Hondacrx
2024-08-31 18:44:32 -04:00
parent a9a28c889e
commit 8b991e1a06
3 changed files with 29 additions and 26 deletions
@@ -331,7 +331,6 @@ namespace Game.Collision
uint RootWMOID;
List<GroupModel> groupModels = new();
BIH groupTree = new();
string name; // valid only while model is held in VMapManager2::iLoadedModelFiles
public override bool IntersectRay(Ray ray, ref float distance, bool stopAtFirstHit, ModelIgnoreFlags ignoreFlags)
{
@@ -423,9 +422,6 @@ namespace Game.Collision
return groupTree.ReadFromFile(reader);
}
public string GetName() { return name; }
public void SetName(string newName) { name = newName; }
public bool IsM2() { return Flags.HasFlag(ModelFlags.IsM2); }
}