Jeck - Fix for set loading / unloading.

* This is a little dirty, as it's loading the profile multiple times. The proper way to do it would be to add any line starting with "unlocked_" to an array for deferred loading. This would also allow us to write those lines back even without the associated set being loaded. The clean solution is on my todo-list now :)
This commit is contained in:
wagic.jeck
2009-09-23 20:36:10 +00:00
parent db8247ddd7
commit b4d261de2f
3 changed files with 8 additions and 9 deletions

View File

@@ -93,7 +93,7 @@ int Options::getID(string name){
//Is it an unlocked set?
string setname = name.substr(strlen("unlocked_"));
if(MtgSets::SetsList){
if(MtgSets::SetsList && MtgSets::SetsList->nb_items){
int unlocked = MtgSets::SetsList->find(setname);
if(unlocked != -1)
return Options::optionSet(unlocked);
@@ -434,12 +434,7 @@ GameSettings::GameSettings()
}
GameSettings::~GameSettings(){
if(globalOptions)
globalOptions->save();
if(profileOptions)
profileOptions->save();
//Destructor no longer saves, to prevent conflicts when MtgSets::SetsList == NULL
SAFE_DELETE(globalOptions);
SAFE_DELETE(profileOptions);
SAFE_DELETE(themeOptions);