Core/Vmaps: Reduce memory used by vmaps (and their size, slightly)

Port From (https://github.com/TrinityCore/TrinityCore/commit/bb8f22ed2013f8cb6b9d61c738f2ebd96b83722f)
This commit is contained in:
hondacrx
2021-04-28 10:32:24 -04:00
parent 8c565b6032
commit 2f031910b3
4 changed files with 64 additions and 64 deletions
@@ -292,19 +292,15 @@ namespace Game.Collision
var model = iLoadedModelFiles.LookupByKey(filename);
if (model == null)
{
WorldModel worldmodel = new();
if (!worldmodel.ReadFile(VMapPath + filename))
model = new ManagedModel();
if (!model.GetModel().ReadFile(VMapPath + filename))
{
Log.outError(LogFilter.Server, "VMapManager: could not load '{0}'", filename);
return null;
}
Log.outDebug(LogFilter.Maps, "VMapManager: loading file '{0}'", filename);
worldmodel.Flags = flags;
model = new ManagedModel();
model.SetModel(worldmodel);
model.GetModel().Flags = flags;
iLoadedModelFiles.Add(filename, model);
}
@@ -382,7 +378,7 @@ namespace Game.Collision
{
public ManagedModel()
{
iModel = null;
iModel = new();
iRefCount = 0;
}