mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-02 07:22:24 +00:00
fs/core: Fix extraction paths
This commit is contained in:
parent
6aaa5423ea
commit
e7f8a9d82e
@ -329,7 +329,15 @@ bool PKG::Extract(const std::filesystem::path& filepath, const std::filesystem::
|
|||||||
} else {
|
} else {
|
||||||
// Set the the folder according to the current inode.
|
// Set the the folder according to the current inode.
|
||||||
// Can be 2 or more (rarely)
|
// Can be 2 or more (rarely)
|
||||||
extractPaths[ndinode_counter] = extract_path.parent_path() / GetTitleID();
|
auto parent_path = extract_path.parent_path();
|
||||||
|
auto title_id = GetTitleID();
|
||||||
|
|
||||||
|
if (parent_path.filename() != title_id) {
|
||||||
|
extractPaths[ndinode_counter] = parent_path / title_id;
|
||||||
|
} else {
|
||||||
|
// DLCs path has different structure
|
||||||
|
extractPaths[ndinode_counter] = extract_path;
|
||||||
|
}
|
||||||
uroot_reached = false;
|
uroot_reached = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -368,10 +376,7 @@ bool PKG::Extract(const std::filesystem::path& filepath, const std::filesystem::
|
|||||||
|
|
||||||
if (table.type == PFS_FILE || table.type == PFS_DIR) {
|
if (table.type == PFS_FILE || table.type == PFS_DIR) {
|
||||||
if (table.type == PFS_DIR) { // Create dirs.
|
if (table.type == PFS_DIR) { // Create dirs.
|
||||||
try {
|
std::filesystem::create_directory(extractPaths[table.inode]);
|
||||||
std::filesystem::create_directory(extractPaths[table.inode]);
|
|
||||||
} catch (std::exception& e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ndinode_counter++;
|
ndinode_counter++;
|
||||||
if ((ndinode_counter + 1) == ndinode) // 1 for the image itself (root).
|
if ((ndinode_counter + 1) == ndinode) // 1 for the image itself (root).
|
||||||
|
Loading…
Reference in New Issue
Block a user