Jeck - Fix issue 96.

This commit is contained in:
wagic.jeck
2009-10-12 23:46:30 +00:00
parent 5b4f703f4e
commit d5556d0a43

View File

@@ -414,7 +414,8 @@ int GameOptions::save(){
//Save it. //Save it.
save_option(&file, it->first, name, &it->second); save_option(&file, it->first, name, &it->second);
} }
file.close();
file.close();
} }
return 1; return 1;
} }
@@ -430,13 +431,11 @@ GameSettings options;
GameSettings::GameSettings() GameSettings::GameSettings()
{ {
//Load global options globalOptions = NULL;
globalOptions = NEW GameOptions(GLOBAL_SETTINGS);
//reloadProfile should be called for the rest.
theGame = NULL; theGame = NULL;
profileOptions = NULL; profileOptions = NULL;
themeOptions = NULL; themeOptions = NULL;
//reloadProfile should be before using options.
} }
GameSettings::~GameSettings(){ GameSettings::~GameSettings(){
@@ -552,6 +551,9 @@ void GameSettings::reloadProfile(bool images){
void GameSettings::checkProfile(){ void GameSettings::checkProfile(){
char buf[512]; char buf[512];
if(!globalOptions)
globalOptions = NEW GameOptions(GLOBAL_SETTINGS);
//If it doesn't exist, load current profile. //If it doesn't exist, load current profile.
if(!profileOptions) if(!profileOptions)
profileOptions = NEW GameOptions(profileFile(PLAYER_SETTINGS,"",false)); profileOptions = NEW GameOptions(profileFile(PLAYER_SETTINGS,"",false));