mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
Include build in to .map files data.
This let not update map fiels format version at switch to new build for prevent use wrong .map files. Build checked at loading.
This commit is contained in:
parent
baab45c0e6
commit
55bc9e8da7
5 changed files with 28 additions and 17 deletions
|
|
@ -45,7 +45,7 @@
|
|||
GridState* si_GridStates[MAX_GRID_STATE];
|
||||
|
||||
static char const* MAP_MAGIC = "MAPS";
|
||||
static char const* MAP_VERSION_MAGIC = "w1.0";
|
||||
static char const* MAP_VERSION_MAGIC = "v1.1";
|
||||
static char const* MAP_AREA_MAGIC = "AREA";
|
||||
static char const* MAP_HEIGHT_MAGIC = "MHGT";
|
||||
static char const* MAP_LIQUID_MAGIC = "MLIQ";
|
||||
|
|
@ -85,7 +85,8 @@ bool Map::ExistMap(uint32 mapid,int gx,int gy)
|
|||
map_fileheader header;
|
||||
fread(&header, sizeof(header), 1, pf);
|
||||
if (header.mapMagic != *((uint32 const*)(MAP_MAGIC)) ||
|
||||
header.versionMagic != *((uint32 const*)(MAP_VERSION_MAGIC)))
|
||||
header.versionMagic != *((uint32 const*)(MAP_VERSION_MAGIC)) ||
|
||||
!IsAcceptableClientBuild(header.buildMagic))
|
||||
{
|
||||
sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp);
|
||||
delete [] tmp;
|
||||
|
|
@ -1193,7 +1194,8 @@ bool GridMap::loadData(char *filename)
|
|||
return true;
|
||||
fread(&header, sizeof(header),1,in);
|
||||
if (header.mapMagic == *((uint32 const*)(MAP_MAGIC)) &&
|
||||
header.versionMagic == *((uint32 const*)(MAP_VERSION_MAGIC)))
|
||||
header.versionMagic == *((uint32 const*)(MAP_VERSION_MAGIC)) ||
|
||||
!IsAcceptableClientBuild(header.buildMagic))
|
||||
{
|
||||
// loadup area data
|
||||
if (header.areaMapOffset && !loadAreaData(in, header.areaMapOffset, header.areaMapSize))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue