From d76b8b7751d2fabfefecd38a2c1b97e392bb2eea Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 25 Jul 2022 14:05:16 -0400 Subject: [PATCH] Temp disabled loading of tilelist, as it was not loading the correct tiles for the maps. --- Source/Game/Maps/TerrainManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Game/Maps/TerrainManager.cs b/Source/Game/Maps/TerrainManager.cs index efb9076f5..852ce368f 100644 --- a/Source/Game/Maps/TerrainManager.cs +++ b/Source/Game/Maps/TerrainManager.cs @@ -179,7 +179,7 @@ namespace Game.Maps { string tileListName = $"{Global.WorldMgr.GetDataPath()}/maps/{GetId():D4}.tilelist"; // tile list is optional - if (File.Exists(tileListName)) + /*if (File.Exists(tileListName)) { using var reader = new BinaryReader(new FileStream(tileListName, FileMode.Open, FileAccess.Read)); var mapMagic = reader.ReadUInt32(); @@ -187,14 +187,14 @@ namespace Game.Maps if (mapMagic == MapConst.MapMagic && versionMagic == MapConst.MapVersionMagic) { var build = reader.ReadUInt32(); - byte[] tilesData = reader.ReadArray(MapConst.MaxGrids * MapConst.MaxGrids); + bool[] tilesData = reader.ReadArray(MapConst.MaxGrids * MapConst.MaxGrids); for (int gx = 0; gx < MapConst.MaxGrids; ++gx) for (int gy = 0; gy < MapConst.MaxGrids; ++gy) _gridFileExists[GetBitsetIndex(gx, gy)] = tilesData[GetBitsetIndex(gx, gy)] == 49; // char of 1 return; } - } + }*/ for (int gx = 0; gx < MapConst.MaxGrids; ++gx) for (int gy = 0; gy < MapConst.MaxGrids; ++gy) @@ -378,7 +378,7 @@ namespace Game.Maps int gy = (int)(MapConst.CenterGridId - y / MapConst.SizeofGrids); //grid y // ensure GridMap is loaded - if (_loadedGrids[GetBitsetIndex(gx, gy)] && loadIfMissing) + if (!_loadedGrids[GetBitsetIndex(gx, gy)] && loadIfMissing) { lock(_loadLock) LoadMapAndVMapImpl(gx, gy);