- fixed main game resource detection for Blood.

* code did not scan .rff files for content-defined versions.
* code did not check content-defined versions for CRC matches.
This commit is contained in:
Christoph Oelckers 2021-12-31 13:04:32 +01:00
parent 1849fe541e
commit 4dbbe892ae

View file

@ -48,7 +48,7 @@
#include "findfile.h"
#include "engineerrors.h"
static const char* res_exts[] = { ".grp", ".zip", ".pk3", ".pk4", ".7z", ".pk7" };
static const char* res_exts[] = { ".grp", ".zip", ".pk3", ".pk4", ".7z", ".pk7", ".rff"};
int g_gameType;
@ -797,11 +797,28 @@ TArray<GrpEntry> GrpScan()
}
if (ok)
{
// got a match
foundGames.Reserve(1);
auto& fg = foundGames.Last();
fg.FileInfo = *grp;
fg.FileName = fe->FileName;
auto checkCRC = [&]() ->bool
{
for (auto& g : allGroups)
{
if (fe->FileLength == g.size)
{
GetCRC(fe, cachedCRCs);
if (fe->CRCValue == g.CRC)
return true;
}
}
return false;
};
if (!checkCRC()) // ignore if the file matches a known entry.
{
// got a match
foundGames.Reserve(1);
auto& fg = foundGames.Last();
fg.FileInfo = *grp;
fg.FileName = fe->FileName;
}
break;
}
}