- fixed file checks for Blood cutscenes.

The stripped drive-less name wasn't passed to the calling code.
This commit is contained in:
Christoph Oelckers 2020-01-26 11:42:02 +01:00
parent 245aa5d3bc
commit 3be4364d6e

View file

@ -161,17 +161,18 @@ void credReset(void)
DoUnFade(1);
}
FileReader credKOpen4Load(FString pzFile)
bool credKOpen4Load(FString &pzFile)
{
int nLen = strlen(pzFile);
FixPathSeperator(pzFile);
auto nHandle = fileSystem.OpenFileReader(pzFile, 0);
if (!nHandle.isOpen())
auto nHandle = fileSystem.FindFile(pzFile);
if (nHandle < 0)
{
// Hack
// Strip the drive letter and retry.
if (nLen >= 3 && isalpha(pzFile[0]) && pzFile[1] == ':' && pzFile[2] == '/')
{
nHandle = fileSystem.OpenFileReader(pzFile.GetChars()+3, 0);
pzFile = pzFile.Mid(3);
nHandle = fileSystem.FindFile(pzFile);
}
}
return nHandle;
@ -200,7 +201,7 @@ void credPlaySmk(const char *_pzSMK, const char *_pzWAV, int nWav)
FString pzSMK = _pzSMK;
FString pzWAV = _pzWAV;
auto nHandleSMK = credKOpen4Load(pzSMK);
if (!nHandleSMK.isOpen())
if (!nHandleSMK)
{
return;
}
@ -238,7 +239,7 @@ void credPlaySmk(const char *_pzSMK, const char *_pzWAV, int nWav)
else
{
auto nHandleWAV = credKOpen4Load(pzWAV);
if (nHandleWAV.isOpen())
if (nHandleWAV)
{
sndStartWavDisk(pzWAV, 255);
}