Fix segfault when settings.vvv or unlock.vvv is missing

To fix this bug, all we have to do is just pass the existing
ScreenSettings* that we have in loadstats() to savestats(), and in
loadsettings() to savesettings().

Fixes #556. Depends on #558.
This commit is contained in:
Misa 2020-12-21 16:40:46 -08:00 committed by Ethan Lee
parent 55163e90d5
commit cbf3da312f
1 changed files with 2 additions and 2 deletions

View File

@ -4474,7 +4474,7 @@ void Game::loadstats(ScreenSettings* screen_settings)
{
// Save unlock.vvv only. Maybe we have a settings.vvv laying around too,
// and we don't want to overwrite that!
savestats();
savestats(screen_settings);
printf("No Stats found. Assuming a new player\n");
}
@ -4953,7 +4953,7 @@ void Game::loadsettings(ScreenSettings* screen_settings)
tinyxml2::XMLDocument doc;
if (!FILESYSTEM_loadTiXml2Document("saves/settings.vvv", doc))
{
savesettings();
savesettings(screen_settings);
puts("No settings.vvv found");
}