mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 00:53:46 +00:00
refactor(Core/Maps): Change map file version from FourCC to uint32 (#7866)
Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com>
This commit is contained in:
@@ -298,7 +298,7 @@ void ReadLiquidTypeTableDBC()
|
||||
|
||||
// Map file format data
|
||||
static char const* MAP_MAGIC = "MAPS";
|
||||
static char const* MAP_VERSION_MAGIC = "v1.8";
|
||||
static uint32 const MAP_VERSION_MAGIC = 8;
|
||||
static char const* MAP_AREA_MAGIC = "AREA";
|
||||
static char const* MAP_HEIGHT_MAGIC = "MHGT";
|
||||
static char const* MAP_LIQUID_MAGIC = "MLIQ";
|
||||
@@ -415,7 +415,7 @@ bool ConvertADT(std::string const& inputPath, std::string const& outputPath, int
|
||||
// Prepare map header
|
||||
map_fileheader map;
|
||||
map.mapMagic = *reinterpret_cast<uint32 const*>(MAP_MAGIC);
|
||||
map.versionMagic = *reinterpret_cast<uint32 const*>(MAP_VERSION_MAGIC);
|
||||
map.versionMagic = MAP_VERSION_MAGIC;
|
||||
map.buildMagic = build;
|
||||
|
||||
// Get area flags data
|
||||
|
||||
@@ -69,7 +69,7 @@ struct map_liquidHeader
|
||||
namespace MMAP
|
||||
{
|
||||
|
||||
char const* MAP_VERSION_MAGIC = "v1.8";
|
||||
uint32 const MAP_VERSION_MAGIC = 8;
|
||||
|
||||
TerrainBuilder::TerrainBuilder(bool skipLiquid) : m_skipLiquid (skipLiquid) { }
|
||||
TerrainBuilder::~TerrainBuilder() = default;
|
||||
@@ -131,7 +131,7 @@ namespace MMAP
|
||||
|
||||
map_fileheader fheader;
|
||||
if (fread(&fheader, sizeof(map_fileheader), 1, mapFile) != 1 ||
|
||||
fheader.versionMagic != *((uint32 const*)(MAP_VERSION_MAGIC)))
|
||||
fheader.versionMagic != MAP_VERSION_MAGIC)
|
||||
{
|
||||
fclose(mapFile);
|
||||
printf("%s is the wrong version, please extract new .map files\n", mapFileName);
|
||||
|
||||
Reference in New Issue
Block a user