From 6723f4c7c2021a00c45ba1c49643548576f2a06f Mon Sep 17 00:00:00 2001 From: Kenix3 Date: Tue, 16 Aug 2022 23:10:13 -0400 Subject: [PATCH] Archive.createArchive error now passes in the error to SPDLOG. --- libultraship/libultraship/Archive.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libultraship/libultraship/Archive.cpp b/libultraship/libultraship/Archive.cpp index 81b0e180e..2740d9d78 100644 --- a/libultraship/libultraship/Archive.cpp +++ b/libultraship/libultraship/Archive.cpp @@ -39,7 +39,7 @@ namespace Ship { std::copy(archivePath.begin(), archivePath.end(), t_filename); bool success = SFileCreateArchive(t_filename, MPQ_CREATE_LISTFILE | MPQ_CREATE_ATTRIBUTES | MPQ_CREATE_ARCHIVE_V2, fileCapacity, &archive->mainMPQ); - int error = GetLastError(); + int32_t error = GetLastError(); delete[] t_filename; @@ -50,7 +50,7 @@ namespace Ship { } else { - SPDLOG_ERROR("({}) We tried to create an archive, but it has fallen and cannot get up."); + SPDLOG_ERROR("({}) We tried to create an archive, but it has fallen and cannot get up.", error); return nullptr; } } @@ -65,12 +65,6 @@ namespace Ship { bool attempt = SFileOpenFileEx(mainMPQ, filePath.c_str(), 0, &fileHandle); - //if (!attempt) - //{ - //std::string filePathAlt = StringHelper::Replace(filePath, "/", "\\"); - //attempt |= SFileOpenFileEx(mainMPQ, filePathAlt.c_str(), 0, &fileHandle); - //} - if (!attempt) { SPDLOG_ERROR("({}) Failed to open file {} from mpq archive {}.", GetLastError(), filePath.c_str(), MainPath.c_str()); std::unique_lock Lock(FileToLoad->FileLoadMutex);