From d5556d0a43f75424d985e46e4e04b7b3851257ce Mon Sep 17 00:00:00 2001 From: "wagic.jeck" Date: Mon, 12 Oct 2009 23:46:30 +0000 Subject: [PATCH] Jeck - Fix issue 96. --- projects/mtg/src/GameOptions.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/mtg/src/GameOptions.cpp b/projects/mtg/src/GameOptions.cpp index 03b08f428..1f7fb374f 100644 --- a/projects/mtg/src/GameOptions.cpp +++ b/projects/mtg/src/GameOptions.cpp @@ -414,7 +414,8 @@ int GameOptions::save(){ //Save it. save_option(&file, it->first, name, &it->second); } - file.close(); + + file.close(); } return 1; } @@ -430,13 +431,11 @@ GameSettings options; GameSettings::GameSettings() { - //Load global options - globalOptions = NEW GameOptions(GLOBAL_SETTINGS); - - //reloadProfile should be called for the rest. + globalOptions = NULL; theGame = NULL; profileOptions = NULL; themeOptions = NULL; + //reloadProfile should be before using options. } GameSettings::~GameSettings(){ @@ -552,6 +551,9 @@ void GameSettings::reloadProfile(bool images){ void GameSettings::checkProfile(){ char buf[512]; + if(!globalOptions) + globalOptions = NEW GameOptions(GLOBAL_SETTINGS); + //If it doesn't exist, load current profile. if(!profileOptions) profileOptions = NEW GameOptions(profileFile(PLAYER_SETTINGS,"",false));