From cda2317ddb4c3b97ab91d22e68283572263e3dbc Mon Sep 17 00:00:00 2001 From: Paris Oplopoios Date: Mon, 30 Sep 2024 19:05:55 +0300 Subject: [PATCH] Fix loading (#1169) --- src/core/file_format/trp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/file_format/trp.cpp b/src/core/file_format/trp.cpp index a1b47dfc..9c53c858 100644 --- a/src/core/file_format/trp.cpp +++ b/src/core/file_format/trp.cpp @@ -69,7 +69,7 @@ bool TRP::Extract(const std::filesystem::path& trophyPath) { file.Read(entry); std::string_view name(entry.entry_name); if (entry.flag == 0 && name.find("TROP") != std::string::npos) { // PNG - if (file.Seek(entry.entry_pos)) { + if (!file.Seek(entry.entry_pos)) { LOG_CRITICAL(Common_Filesystem, "Failed to seek to TRP entry offset"); return false; } @@ -79,7 +79,7 @@ bool TRP::Extract(const std::filesystem::path& trophyPath) { } if (entry.flag == 3 && np_comm_id[0] == 'N' && np_comm_id[1] == 'P') { // ESFM, encrypted. - if (file.Seek(entry.entry_pos)) { + if (!file.Seek(entry.entry_pos)) { LOG_CRITICAL(Common_Filesystem, "Failed to seek to TRP entry offset"); return false; } @@ -88,7 +88,7 @@ bool TRP::Extract(const std::filesystem::path& trophyPath) { // clean xml file. std::vector ESFM(entry.entry_len - iv_len); std::vector XML(entry.entry_len - iv_len); - if (file.Seek(entry.entry_pos + iv_len)) { + if (!file.Seek(entry.entry_pos + iv_len)) { LOG_CRITICAL(Common_Filesystem, "Failed to seek to TRP entry + iv offset"); return false; }