mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-23 16:48:52 -05:00
Archive.createArchive error now passes in the error to SPDLOG.
This commit is contained in:
parent
f9621dcc17
commit
6723f4c7c2
@ -39,7 +39,7 @@ namespace Ship {
|
|||||||
std::copy(archivePath.begin(), archivePath.end(), t_filename);
|
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);
|
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;
|
delete[] t_filename;
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ namespace Ship {
|
|||||||
}
|
}
|
||||||
else
|
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;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,12 +65,6 @@ namespace Ship {
|
|||||||
|
|
||||||
bool attempt = SFileOpenFileEx(mainMPQ, filePath.c_str(), 0, &fileHandle);
|
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) {
|
if (!attempt) {
|
||||||
SPDLOG_ERROR("({}) Failed to open file {} from mpq archive {}.", GetLastError(), filePath.c_str(), MainPath.c_str());
|
SPDLOG_ERROR("({}) Failed to open file {} from mpq archive {}.", GetLastError(), filePath.c_str(), MainPath.c_str());
|
||||||
std::unique_lock<std::mutex> Lock(FileToLoad->FileLoadMutex);
|
std::unique_lock<std::mutex> Lock(FileToLoad->FileLoadMutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user