Archive.createArchive error now passes in the error to SPDLOG.

This commit is contained in:
Kenix3 2022-08-16 23:10:13 -04:00
parent f9621dcc17
commit 6723f4c7c2

View File

@ -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<std::mutex> Lock(FileToLoad->FileLoadMutex);