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
{
ByteString currentFileName = Platform::WinNarrow(currentFile.name);
if (currentFileName.length()>4)
directoryList.push_back(directory+currentFileName);
if (currentFileName.length() > 4)
directoryList.push_back(currentFileName);
}
while (_wfindnext(findFileHandle, &currentFile) == 0);
_findclose(findFileHandle);

View File

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