Skip to content

Commit

Permalink
updated to read files from Save first before game files
Browse files Browse the repository at this point in the history
  • Loading branch information
enewey committed Oct 13, 2023
1 parent 8d32f7a commit c4f1ac3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/filefinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ std::string find_generic(const DirectoryTree::Args& args) {
}

std::string find_generic_with_fallback(DirectoryTree::Args& args) {
std::string found = find_generic(args);
std::string found = FileFinder::Save().FindFile(args);
if (found.empty()) {
return FileFinder::Save().FindFile(args);
return find_generic(args);
}

return found;
Expand Down Expand Up @@ -393,8 +393,8 @@ Filesystem_Stream::InputStream open_generic(StringView dir, StringView name, Dir
}

Filesystem_Stream::InputStream open_generic_with_fallback(StringView dir, StringView name, DirectoryTree::Args& args) {
auto is = open_generic(dir, name, args);
if (!is) { is = FileFinder::Save().OpenFile(args); }
auto is = FileFinder::Save().OpenFile(args);
if (!is) { is = open_generic(dir, name, args); }
if (!is) {
Output::Debug("Unable to open in either Game or Save: {}/{}", dir, name);
}
Expand Down

0 comments on commit c4f1ac3

Please sign in to comment.