Fix local saves and migration process on Windows

This commit is contained in:
jacob1 2021-07-04 14:35:25 -04:00
parent fe49e58de8
commit fb3fcfcdb7
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995
2 changed files with 4 additions and 2 deletions

View File

@ -307,8 +307,8 @@ std::vector<ByteString> DirectorySearch(ByteString directory, ByteString search,
do do
{ {
ByteString currentFileName = Platform::WinNarrow(currentFile.name); ByteString currentFileName = Platform::WinNarrow(currentFile.name);
if (currentFileName.length()>4) if (currentFileName.length() > 4)
directoryList.push_back(directory+currentFileName); directoryList.push_back(currentFileName);
} }
while (_wfindnext(findFileHandle, &currentFile) == 0); while (_wfindnext(findFileHandle, &currentFile) == 0);
_findclose(findFileHandle); _findclose(findFileHandle);

View File

@ -48,6 +48,8 @@ class LoadFilesTask: public Task
try try
{ {
std::vector<unsigned char> data = Client::Ref().ReadFile(directory + *iter); std::vector<unsigned char> data = Client::Ref().ReadFile(directory + *iter);
if (data.empty())
continue;
GameSave * tempSave = new GameSave(data); GameSave * tempSave = new GameSave(data);
saveFile->SetGameSave(tempSave); saveFile->SetGameSave(tempSave);
saveFiles.push_back(saveFile); saveFiles.push_back(saveFile);