save Game pref as string, not integer

This commit is contained in:
Chris Danford
2004-04-19 23:34:11 +00:00
parent 0b5644a9b9
commit edb8d968ff
+6 -5
View File
@@ -742,11 +742,12 @@ void ReadGamePrefsFromDisk( bool bSwitchToLastPlayedGame )
if( bSwitchToLastPlayedGame )
{
Game game;
if( ini.GetValue("Options", "Game", (int&)game) )
CString sGame;
if( ini.GetValue("Options", "Game", sGame) )
{
CLAMP( (int&)game, 0, NUM_GAMES-1 );
GAMESTATE->m_CurGame = game;
GAMESTATE->m_CurGame = GAMEMAN->StringToGameType( sGame );
if( GAMESTATE->m_CurGame == GAME_INVALID )
GAMESTATE->m_CurGame = (Game)0;
}
}
}
@@ -765,7 +766,7 @@ void SaveGamePrefsToDisk()
ini.SetValue( sGameName, "Announcer", ANNOUNCER->GetCurAnnouncerName() );
ini.SetValue( sGameName, "Theme", THEME->GetCurThemeName() );
ini.SetValue( sGameName, "DefaultModifiers", PREFSMAN->m_sDefaultModifiers );
ini.SetValue( "Options", "Game", GAMESTATE->m_CurGame );
ini.SetValue( "Options", "Game", (CString)GAMESTATE->GetCurrentGameDef()->m_szName );
ini.WriteFile();
}