Temp disabled loading of tilelist, as it was not loading the correct tiles for the maps.

This commit is contained in:
hondacrx
2022-07-25 14:05:16 -04:00
parent 9278f0b3c7
commit d76b8b7751
+4 -4
View File
@@ -179,7 +179,7 @@ namespace Game.Maps
{ {
string tileListName = $"{Global.WorldMgr.GetDataPath()}/maps/{GetId():D4}.tilelist"; string tileListName = $"{Global.WorldMgr.GetDataPath()}/maps/{GetId():D4}.tilelist";
// tile list is optional // tile list is optional
if (File.Exists(tileListName)) /*if (File.Exists(tileListName))
{ {
using var reader = new BinaryReader(new FileStream(tileListName, FileMode.Open, FileAccess.Read)); using var reader = new BinaryReader(new FileStream(tileListName, FileMode.Open, FileAccess.Read));
var mapMagic = reader.ReadUInt32(); var mapMagic = reader.ReadUInt32();
@@ -187,14 +187,14 @@ namespace Game.Maps
if (mapMagic == MapConst.MapMagic && versionMagic == MapConst.MapVersionMagic) if (mapMagic == MapConst.MapMagic && versionMagic == MapConst.MapVersionMagic)
{ {
var build = reader.ReadUInt32(); var build = reader.ReadUInt32();
byte[] tilesData = reader.ReadArray<byte>(MapConst.MaxGrids * MapConst.MaxGrids); bool[] tilesData = reader.ReadArray<bool>(MapConst.MaxGrids * MapConst.MaxGrids);
for (int gx = 0; gx < MapConst.MaxGrids; ++gx) for (int gx = 0; gx < MapConst.MaxGrids; ++gx)
for (int gy = 0; gy < MapConst.MaxGrids; ++gy) for (int gy = 0; gy < MapConst.MaxGrids; ++gy)
_gridFileExists[GetBitsetIndex(gx, gy)] = tilesData[GetBitsetIndex(gx, gy)] == 49; // char of 1 _gridFileExists[GetBitsetIndex(gx, gy)] = tilesData[GetBitsetIndex(gx, gy)] == 49; // char of 1
return; return;
} }
} }*/
for (int gx = 0; gx < MapConst.MaxGrids; ++gx) for (int gx = 0; gx < MapConst.MaxGrids; ++gx)
for (int gy = 0; gy < MapConst.MaxGrids; ++gy) 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 int gy = (int)(MapConst.CenterGridId - y / MapConst.SizeofGrids); //grid y
// ensure GridMap is loaded // ensure GridMap is loaded
if (_loadedGrids[GetBitsetIndex(gx, gy)] && loadIfMissing) if (!_loadedGrids[GetBitsetIndex(gx, gy)] && loadIfMissing)
{ {
lock(_loadLock) lock(_loadLock)
LoadMapAndVMapImpl(gx, gy); LoadMapAndVMapImpl(gx, gy);