ContentManager: add more checks for folder-packages

Fixes problems with folder packages not being created
This commit is contained in:
emoose 2018-11-02 01:08:34 +00:00 committed by illusion
parent ab41204a61
commit b7857d77c6
3 changed files with 19 additions and 15 deletions

View File

@ -151,6 +151,7 @@ X_STATUS UserModule::LoadFromFile(const std::string_view path) {
patch_entry = file_system->ResolvePath(path_ + "p"); patch_entry = file_system->ResolvePath(path_ + "p");
} }
if (patch_entry) {
auto patch_path = patch_entry->absolute_path(); auto patch_path = patch_entry->absolute_path();
XELOGI("Loading XEX patch from {}", patch_path); XELOGI("Loading XEX patch from {}", patch_path);
@ -169,6 +170,7 @@ X_STATUS UserModule::LoadFromFile(const std::string_view path) {
return X_STATUS_UNSUCCESSFUL; return X_STATUS_UNSUCCESSFUL;
} }
} }
}
return LoadXexContinue(); return LoadXexContinue();
} }

View File

@ -67,6 +67,8 @@ std::filesystem::path ContentManager::ResolvePackagePath(
if (!std::filesystem::exists(package_path) || if (!std::filesystem::exists(package_path) ||
entry.type == filesystem::FileInfo::Type::kDirectory) { 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; package_path += xe::kPathSeparator;
} }
return package_path; return package_path;

View File

@ -97,8 +97,8 @@ class ContentManager {
xe::global_critical_region global_critical_region_; xe::global_critical_region global_critical_region_;
std::vector<ContentPackage*> open_packages_; std::vector<ContentPackage*> open_packages_;
uint32_t title_id_override_; // can be used for games/apps that request uint32_t title_id_override_ =
// content for other IDs 0; // can be used for games/apps that request content for other IDs
}; };
} // namespace xam } // namespace xam