fixed state transitions from highscore->main menu

This commit is contained in:
2011-04-19 13:20:46 +02:00
parent 3950195593
commit 545c370816
6 changed files with 34 additions and 12 deletions
+18
View File
@@ -179,6 +179,24 @@ float &GetVariableFloat (const std::string &name, float def) {
return var->GetFloatValue ();
}
/** \brief Returns the boolean value of the Variable with the given name */
bool& GetVariableBool (const std::string &name, bool def) {
/* We use a static result variable for the case that def was not passed to
* is function */
static bool def_result = def;
if (! VariablesInstance ) {
LogError ("Unable to register Variable '%s': Variables System not initialized!", name.c_str());
return def_result;
}
Variable *var = VariablesInstance->GetVariable (name);
if (!var) {
return def_result;
}
return var->GetBoolValue ();
}
}