fix crash from previous commit

This commit is contained in:
jacob1 2015-12-16 14:06:44 -05:00
parent 8d4e333986
commit 762093371b

View File

@ -1098,11 +1098,12 @@ void GameController::OpenLocalSaveWindow(bool asCurrent)
sim->SaveSimOptions(gameSave); sim->SaveSimOptions(gameSave);
gameSave->paused = gameModel->GetPaused(); gameSave->paused = gameModel->GetPaused();
std::string filename = ""; SaveFile tempSave("");
if (gameModel->GetSaveFile()) if (gameModel->GetSaveFile())
filename = gameModel->GetSaveFile()->GetName(); {
SaveFile tempSave(filename); tempSave.SetFileName(gameModel->GetSaveFile()->GetName());
tempSave.SetDisplayName(gameModel->GetSaveFile()->GetDisplayName()); tempSave.SetDisplayName(gameModel->GetSaveFile()->GetDisplayName());
}
tempSave.SetGameSave(gameSave); tempSave.SetGameSave(gameSave);
if (!asCurrent || !gameModel->GetSaveFile()) if (!asCurrent || !gameModel->GetSaveFile())