diff --git a/Source/Framework/Constants/MapConst.cs b/Source/Framework/Constants/MapConst.cs index 5d2a16a93..1b08c1d29 100644 --- a/Source/Framework/Constants/MapConst.cs +++ b/Source/Framework/Constants/MapConst.cs @@ -65,6 +65,7 @@ namespace Framework.Constants public const uint MapMagic = 0x5350414D; //"MAPS"; public const uint MapVersionMagic = 0x392E3176; //"v1.9"; + public const uint MapVersionMagic2 = 0x302E3276; //"v2.0"; // Hack for some different extractors using v2.0 header public const uint MapAreaMagic = 0x41455241; //"AREA"; public const uint MapHeightMagic = 0x5447484D; //"MHGT"; public const uint MapLiquidMagic = 0x51494C4D; //"MLIQ"; diff --git a/Source/Game/Maps/GridMap.cs b/Source/Game/Maps/GridMap.cs index 176a921ee..2395c18e6 100644 --- a/Source/Game/Maps/GridMap.cs +++ b/Source/Game/Maps/GridMap.cs @@ -46,7 +46,7 @@ namespace Game.Maps using (BinaryReader reader = new BinaryReader(new FileStream(filename, FileMode.Open, FileAccess.Read))) { MapFileHeader header = reader.Read(); - if (header.mapMagic != MapConst.MapMagic || header.versionMagic != MapConst.MapVersionMagic) + if (header.mapMagic != MapConst.MapMagic || (header.versionMagic != MapConst.MapVersionMagic && header.versionMagic != MapConst.MapVersionMagic2)) // Hack for some different extractors using v2.0 header { Log.outError(LogFilter.Maps, $"Map file '{filename}' is from an incompatible map version. Please recreate using the mapextractor."); return LoadResult.ReadFromFileFailed; diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index dd5e82fdc..08979aa66 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -141,7 +141,7 @@ namespace Game.Maps using (var reader = new BinaryReader(new FileStream(fileName, FileMode.Open, FileAccess.Read))) { var header = reader.Read(); - if (header.mapMagic != MapConst.MapMagic || header.versionMagic != MapConst.MapVersionMagic) + if (header.mapMagic != MapConst.MapMagic || (header.versionMagic != MapConst.MapVersionMagic && header.versionMagic != MapConst.MapVersionMagic2)) // Hack for some different extractors using v2.0 header { Log.outError(LogFilter.Maps, "Map file '{0}' is from an incompatible map version ({1}), {2} is expected. Please recreate using the mapextractor.", fileName, header.versionMagic, MapConst.MapVersionMagic);