mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #7348 from Robyt3/Tools-Map-Version-Check
Fix map version checks in map_diff and map_extract tools
This commit is contained in:
commit
788a2ad1ff
|
@ -17,11 +17,13 @@ bool Process(IStorage *pStorage, const char **pMapNames)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check version
|
const CMapItemVersion *pVersion = static_cast<CMapItemVersion *>(aMaps[i].FindItem(MAPITEMTYPE_VERSION, 0));
|
||||||
CMapItemVersion *pVersion = (CMapItemVersion *)aMaps[i].FindItem(MAPITEMTYPE_VERSION, 0);
|
if(pVersion == nullptr || pVersion->m_Version != CMapItemVersion::CURRENT_VERSION)
|
||||||
if(pVersion && pVersion->m_Version != 1)
|
{
|
||||||
|
dbg_msg("map_compare", "unsupported map version '%s'", pMapNames[i]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int aStart[2], aNum[2];
|
int aStart[2], aNum[2];
|
||||||
for(int i = 0; i < 2; ++i)
|
for(int i = 0; i < 2; ++i)
|
||||||
|
|
|
@ -16,10 +16,12 @@ bool Process(IStorage *pStorage, const char *pMapName, const char *pPathSave)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check version
|
const CMapItemVersion *pVersion = static_cast<CMapItemVersion *>(Reader.FindItem(MAPITEMTYPE_VERSION, 0));
|
||||||
CMapItemVersion *pVersion = (CMapItemVersion *)Reader.FindItem(MAPITEMTYPE_VERSION, 0);
|
if(pVersion == nullptr || pVersion->m_Version != CMapItemVersion::CURRENT_VERSION)
|
||||||
if(pVersion && pVersion->m_Version != 1)
|
{
|
||||||
|
dbg_msg("map_extract", "unsupported map version '%s'", pMapName);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
dbg_msg("map_extract", "Make sure you have the permission to use these images and sounds in your own maps");
|
dbg_msg("map_extract", "Make sure you have the permission to use these images and sounds in your own maps");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue