- fix loading of CRC cache if file does not exist.

This commit is contained in:
Mitchell Richters 2020-04-15 21:35:16 +10:00 committed by Christoph Oelckers
parent 4654fd648d
commit 587a5d5d9a
2 changed files with 14 additions and 12 deletions

View file

@ -1119,7 +1119,7 @@ void FScanner::CheckOpen()
{ {
if (ScriptOpen == false) if (ScriptOpen == false)
{ {
I_FatalError ("SC_ call before SC_Open()."); I_Error ("SC_ call before SC_Open().");
} }
} }

View file

@ -328,7 +328,8 @@ static TArray<FileEntry> LoadCRCCache(void)
try try
{ {
sc.OpenFile(cachepath); if (sc.OpenFile(cachepath))
{
while (sc.GetString()) while (sc.GetString())
{ {
crclist.Reserve(1); crclist.Reserve(1);
@ -342,6 +343,7 @@ static TArray<FileEntry> LoadCRCCache(void)
flentry.CRCValue = (unsigned)sc.BigNumber; flentry.CRCValue = (unsigned)sc.BigNumber;
} }
} }
}
catch (CRecoverableError &) catch (CRecoverableError &)
{ {
// If there's a parsing error, return what we got and discard the rest. // If there's a parsing error, return what we got and discard the rest.