fixed state transitions from highscore->main menu
This commit is contained in:
@@ -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 ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user