Add extractors and assembler - EXTRACTION OF NEW MAPS IS REQUIRED!

This will allow for easier testing of functionality between different
projects, ie. one set of maps/vmaps instead of 2 (saves space, saves
time and saves us some confusion).

--HG--
branch : trunk
This commit is contained in:
click
2010-06-11 05:01:30 +02:00
parent d6d9d50952
commit 39e793b2bd
15 changed files with 246 additions and 670 deletions

View File

@@ -94,10 +94,9 @@ bool Map::ExistMap(uint32 mapid,int gx,int gy)
map_fileheader header;
fread(&header, sizeof(header), 1, pf);
if (header.mapMagic != uint32(MAP_MAGIC) ||
header.versionMagic != uint32(MAP_VERSION_MAGIC))
if (header.mapMagic != uint32(MAP_MAGIC) || header.versionMagic != uint32(MAP_VERSION_MAGIC))
{
sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp);
sLog.outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.",tmp);
delete [] tmp;
fclose(pf); //close file before return
return false;
@@ -1209,8 +1208,7 @@ bool GridMap::loadData(char *filename)
if (!in)
return true;
fread(&header, sizeof(header),1,in);
if (header.mapMagic == uint32(MAP_MAGIC) &&
header.versionMagic == uint32(MAP_VERSION_MAGIC))
if (header.mapMagic == uint32(MAP_MAGIC) && header.versionMagic == uint32(MAP_VERSION_MAGIC))
{
// loadup area data
if (header.areaMapOffset && !loadAreaData(in, header.areaMapOffset, header.areaMapSize))
@@ -1236,7 +1234,7 @@ bool GridMap::loadData(char *filename)
fclose(in);
return true;
}
sLog.outError("Map file '%s' is a non-compatible version (outdated?). Please, create new using the ad.exe program.", filename);
sLog.outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", filename);
fclose(in);
return false;
}