mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-26 04:16:18 +00:00
Add option to ignore game patch (#3039)
* impl * fix * cleanup * more * clang + * why
This commit is contained in:
parent
e0c930f2d8
commit
9981c8df03
5 changed files with 39 additions and 28 deletions
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Core::FileSys {
|
||||
|
||||
bool MntPoints::ignore_game_patches = false;
|
||||
|
||||
std::string RemoveTrailingSlashes(const std::string& path) {
|
||||
// Remove trailing slashes to make comparisons simpler.
|
||||
std::string path_sanitized = path;
|
||||
|
@ -77,7 +79,7 @@ std::filesystem::path MntPoints::GetHostPath(std::string_view path, bool* is_rea
|
|||
patch_path /= rel_path;
|
||||
|
||||
if ((corrected_path.starts_with("/app0") || corrected_path.starts_with("/hostapp")) &&
|
||||
!force_base_path && std::filesystem::exists(patch_path)) {
|
||||
!force_base_path && !ignore_game_patches && std::filesystem::exists(patch_path)) {
|
||||
return patch_path;
|
||||
}
|
||||
|
||||
|
@ -137,7 +139,7 @@ std::filesystem::path MntPoints::GetHostPath(std::string_view path, bool* is_rea
|
|||
return std::optional<std::filesystem::path>(current_path);
|
||||
};
|
||||
|
||||
if (!force_base_path) {
|
||||
if (!force_base_path && !ignore_game_patches) {
|
||||
if (const auto path = search(patch_path)) {
|
||||
return *path;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ class MntPoints {
|
|||
static constexpr bool NeedsCaseInsensitiveSearch = true;
|
||||
#endif
|
||||
public:
|
||||
static bool ignore_game_patches;
|
||||
struct MntPair {
|
||||
std::filesystem::path host_path;
|
||||
std::string mount; // e.g /app0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue