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,10 +17,12 @@ bool Process(IStorage *pStorage, const char **pMapNames)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check version
|
||||
CMapItemVersion *pVersion = (CMapItemVersion *)aMaps[i].FindItem(MAPITEMTYPE_VERSION, 0);
|
||||
if(pVersion && pVersion->m_Version != 1)
|
||||
const CMapItemVersion *pVersion = static_cast<CMapItemVersion *>(aMaps[i].FindItem(MAPITEMTYPE_VERSION, 0));
|
||||
if(pVersion == nullptr || pVersion->m_Version != CMapItemVersion::CURRENT_VERSION)
|
||||
{
|
||||
dbg_msg("map_compare", "unsupported map version '%s'", pMapNames[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int aStart[2], aNum[2];
|
||||
|
|
|
@ -16,10 +16,12 @@ bool Process(IStorage *pStorage, const char *pMapName, const char *pPathSave)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check version
|
||||
CMapItemVersion *pVersion = (CMapItemVersion *)Reader.FindItem(MAPITEMTYPE_VERSION, 0);
|
||||
if(pVersion && pVersion->m_Version != 1)
|
||||
const CMapItemVersion *pVersion = static_cast<CMapItemVersion *>(Reader.FindItem(MAPITEMTYPE_VERSION, 0));
|
||||
if(pVersion == nullptr || pVersion->m_Version != CMapItemVersion::CURRENT_VERSION)
|
||||
{
|
||||
dbg_msg("map_extract", "unsupported map version '%s'", pMapName);
|
||||
return false;
|
||||
}
|
||||
|
||||
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