DIRECTOR: Fix searching for files in subdirectories

Fixes regression introduced in 0c09bba0f61d3a435112c517c9ff7b1054bdf07e

Fixes resource detection in Total Distortion.
This commit is contained in:
Scott Percival 2022-09-09 21:17:27 +08:00 committed by Eugene Sandulenko
parent af0dd7abe1
commit 533dd7c78f

View File

@ -427,9 +427,9 @@ bool testPath(Common::String &path, bool directory) {
// for each element in the path, choose the first FSNode
// with a case-insensitive matcing name
if (i->getName().equalsIgnoreCase(token)) {
// If this is a directory, it's not a valid candidate
// If this the final path component, check if we're allowed to match with a directory
node = Common::FSNode(*i);
if (node.isDirectory()) {
if (directory_list.empty() && !directory && node.isDirectory()) {
continue;
}