Fix crash when overwriting a local save
This commit is contained in:
parent
5b708219c0
commit
90004242d6
@ -1163,10 +1163,10 @@ void GameController::OpenLocalSaveWindow(bool asCurrent)
|
||||
tempSave->SetFileName(gameModel->GetSaveFile()->GetName());
|
||||
tempSave->SetDisplayName(gameModel->GetSaveFile()->GetDisplayName());
|
||||
}
|
||||
tempSave->SetGameSave(std::move(gameSave));
|
||||
|
||||
if (!asCurrent || !gameModel->GetSaveFile())
|
||||
{
|
||||
tempSave->SetGameSave(std::move(gameSave));
|
||||
new LocalSaveActivity(std::move(tempSave), [this](auto file) {
|
||||
gameModel->SetSaveFile(std::move(file), gameView->ShiftBehaviour());
|
||||
});
|
||||
@ -1183,6 +1183,7 @@ void GameController::OpenLocalSaveWindow(bool asCurrent)
|
||||
|
||||
Platform::MakeDirectory(LOCAL_SAVE_DIR);
|
||||
auto [ fromNewerVersion, saveData ] = gameSave->Serialise();
|
||||
tempSave->SetGameSave(std::move(gameSave));
|
||||
gameModel->SetSaveFile(std::move(tempSave), gameView->ShiftBehaviour());
|
||||
(void)fromNewerVersion;
|
||||
if (saveData.size() == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user