mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-20 18:52:43 +00:00
- Blood: fixed path validation for cutscene files.
This commit is contained in:
parent
a12dfbe1d8
commit
1a5a2aba2b
1 changed files with 10 additions and 2 deletions
|
@ -156,10 +156,18 @@ static FString cleanPath(const char* pth)
|
|||
{
|
||||
FString path = pth;
|
||||
FixPathSeperator(path);
|
||||
if (FileExists(path)) return path;
|
||||
if (fileSystem.FileExists(path)) return path;
|
||||
if (path.Len() > 3 && path[1] == ':' && isalpha(path[0]) && path[2] == '/')
|
||||
{
|
||||
return path.Mid(3);
|
||||
path = path.Mid(3);
|
||||
if (fileSystem.FileExists(path)) return path;
|
||||
}
|
||||
// optionally strip the first path component to account for poor logic of the DOS EXE.
|
||||
auto pos = path.IndexOf("/");
|
||||
if (pos >= 0)
|
||||
{
|
||||
auto npath = path.Mid(pos + 1);
|
||||
if (fileSystem.FileExists(npath)) return npath;
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue