ContentManager: add more checks for folder-packages
Fixes problems with folder packages not being created
This commit is contained in:
parent
ab41204a61
commit
b7857d77c6
|
@ -151,22 +151,24 @@ X_STATUS UserModule::LoadFromFile(const std::string_view path) {
|
|||
patch_entry = file_system->ResolvePath(path_ + "p");
|
||||
}
|
||||
|
||||
auto patch_path = patch_entry->absolute_path();
|
||||
XELOGI("Loading XEX patch from {}", patch_path);
|
||||
if (patch_entry) {
|
||||
auto patch_path = patch_entry->absolute_path();
|
||||
XELOGI("Loading XEX patch from {}", patch_path);
|
||||
|
||||
auto patch_module = object_ref<UserModule>(new UserModule(kernel_state_));
|
||||
result = patch_module->LoadFromFile(patch_path);
|
||||
if (!result) {
|
||||
result = patch_module->xex_module()->ApplyPatch(xex_module());
|
||||
if (result) {
|
||||
XELOGE("Failed to apply XEX patch, code: {}", result);
|
||||
auto patch_module = object_ref<UserModule>(new UserModule(kernel_state_));
|
||||
result = patch_module->LoadFromFile(patch_path);
|
||||
if (!result) {
|
||||
result = patch_module->xex_module()->ApplyPatch(xex_module());
|
||||
if (result) {
|
||||
XELOGE("Failed to apply XEX patch, code: {}", result);
|
||||
}
|
||||
} else {
|
||||
XELOGE("Failed to load XEX patch, code: {}", result);
|
||||
}
|
||||
} else {
|
||||
XELOGE("Failed to load XEX patch, code: {}", result);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
return X_STATUS_UNSUCCESSFUL;
|
||||
if (result) {
|
||||
return X_STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return LoadXexContinue();
|
||||
|
|
|
@ -67,6 +67,8 @@ std::filesystem::path ContentManager::ResolvePackagePath(
|
|||
|
||||
if (!std::filesystem::exists(package_path) ||
|
||||
entry.type == filesystem::FileInfo::Type::kDirectory) {
|
||||
// Add slash to end of path if this is a folder
|
||||
// (or package doesn't exist, meaning we're creating a new folder)
|
||||
package_path += xe::kPathSeparator;
|
||||
}
|
||||
return package_path;
|
||||
|
|
|
@ -97,8 +97,8 @@ class ContentManager {
|
|||
xe::global_critical_region global_critical_region_;
|
||||
std::vector<ContentPackage*> open_packages_;
|
||||
|
||||
uint32_t title_id_override_; // can be used for games/apps that request
|
||||
// content for other IDs
|
||||
uint32_t title_id_override_ =
|
||||
0; // can be used for games/apps that request content for other IDs
|
||||
};
|
||||
|
||||
} // namespace xam
|
||||
|
|
Loading…
Reference in New Issue