mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
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:
parent
0ad96f6901
commit
839009fc93
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue