mirror of https://github.com/PCSX2/pcsx2.git
Achievements: Implement the ELF suffix hack from CDVD when hashing
This commit is contained in:
parent
57581724cd
commit
1fa6614cd5
|
@ -1359,8 +1359,19 @@ std::optional<std::vector<u8>> Achievements::ReadELFFromCurrentDisc(const std::s
|
||||||
std::optional<std::vector<u8>> ret;
|
std::optional<std::vector<u8>> ret;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// ELF suffix hack. Taken from CDVD::loadElf
|
||||||
|
// MLB2k6 has an elf whose suffix is actually ;2
|
||||||
|
std::string filepath(elf_path);
|
||||||
|
const std::string::size_type semi_pos = filepath.rfind(';');
|
||||||
|
if (semi_pos != std::string::npos && std::string_view(filepath).substr(semi_pos) != ";1")
|
||||||
|
{
|
||||||
|
Console.Warning("(Achievements) Non-conforming version suffix (%s) detected and replaced.", elf_path.c_str());
|
||||||
|
filepath.erase(semi_pos);
|
||||||
|
filepath += ";1";
|
||||||
|
}
|
||||||
|
|
||||||
IsoFSCDVD isofs;
|
IsoFSCDVD isofs;
|
||||||
IsoFile file(isofs, elf_path);
|
IsoFile file(isofs, filepath);
|
||||||
const u32 size = file.getLength();
|
const u32 size = file.getLength();
|
||||||
|
|
||||||
ret = std::vector<u8>();
|
ret = std::vector<u8>();
|
||||||
|
|
Loading…
Reference in New Issue