Prefer downloadedmaps over maps ( #1702 )

Fixes corrupted demos if there is a different version of the current map in the maps/ folder.
Thanks to @archimede67 for initial research.
This commit is contained in:
ChillerDragon 2019-06-05 22:24:17 +02:00
parent 0ad96f6901
commit 839009fc93

View file

@ -68,13 +68,13 @@ int CDemoRecorder::Start(class IStorage *pStorage, class IConsole *pConsole, con
{
// open mapfile
char aMapFilename[128];
// try the normal maps folder
str_format(aMapFilename, sizeof(aMapFilename), "maps/%s.map", pMap);
// try the downloaded maps
str_format(aMapFilename, sizeof(aMapFilename), "downloadedmaps/%s_%08x.map", pMap, Crc);
MapFile = pStorage->OpenFile(aMapFilename, IOFLAG_READ, IStorage::TYPE_ALL);
if(!MapFile)
{
// try the downloaded maps
str_format(aMapFilename, sizeof(aMapFilename), "downloadedmaps/%s_%08x.map", pMap, Crc);
// try the normal maps folder
str_format(aMapFilename, sizeof(aMapFilename), "maps/%s.map", pMap);
MapFile = pStorage->OpenFile(aMapFilename, IOFLAG_READ, IStorage::TYPE_ALL);
}
if(!MapFile)