DIRECTOR: Improved file search in pathMakeRelative()

This commit is contained in:
Eugene Sandulenko 2022-03-19 12:12:47 +01:00
parent d7c3615716
commit 835f961782
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -394,6 +394,10 @@ Common::String getPath(Common::String path, Common::String cwd) {
bool testPath(Common::String &path, bool directory) {
Common::FSNode d = Common::FSNode(*g_director->getGameDataDir());
// Test if we have it right in the SearchMan
if (SearchMan.hasFile(Common::Path(path, g_director->_dirSeparator)))
return true;
// check for the game data dir
if (!path.contains(g_director->_dirSeparator) && path.equalsIgnoreCase(d.getName())) {
if (!directory)