Core/Maps: Should fix spam about not being able to unload files

This commit is contained in:
hondacrx
2018-08-29 14:42:53 -04:00
parent 520aaf3ceb
commit 32ed5530d4
2 changed files with 4 additions and 4 deletions
@@ -236,11 +236,12 @@ namespace Game.Collision
{
lock (LoadedModelFilesLock)
{
filename = filename.TrimEnd('\0');
var model = iLoadedModelFiles.LookupByKey(filename);
if (model == null)
{
WorldModel worldmodel = new WorldModel();
if (!worldmodel.readFile(VMapPath + filename + ".vmo"))
if (!worldmodel.readFile(VMapPath + filename))
{
Log.outError(LogFilter.Server, "VMapManager: could not load '{0}'", filename);
return null;
@@ -261,7 +262,7 @@ namespace Game.Collision
{
lock (LoadedModelFilesLock)
{
filename = filename.Replace("\0", "");
filename = filename.TrimEnd('\0');
var model = iLoadedModelFiles.LookupByKey(filename);
if (model == null)
{
+1 -2
View File
@@ -363,10 +363,9 @@ namespace Game.Collision
public bool readFile(string filename)
{
filename = filename.Replace("\0", "");
if (!File.Exists(filename))
{
filename = filename.Replace(".vmo", "");
filename = filename + ".vmo";
if (!File.Exists(filename))
return false;
}