mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 09:31:14 +00:00
- fixed: CVar.ResetToDefault was missing a check for use outside of menus.
This commit is contained in:
parent
a9cc7e6fb9
commit
17a33b609a
1 changed files with 12 additions and 3 deletions
|
@ -232,7 +232,7 @@ DEFINE_ACTION_FUNCTION(_CVar, SetInt)
|
|||
// Only menus are allowed to change non-mod CVARs.
|
||||
if (DMenu::InMenu == 0)
|
||||
{
|
||||
I_FatalError("Attempt to change CVAR '%s' outside of menu code", self->GetName());
|
||||
ThrowAbortException(X_OTHER, "Attempt to change CVAR '%s' outside of menu code", self->GetName());
|
||||
}
|
||||
}
|
||||
PARAM_INT(val);
|
||||
|
@ -250,7 +250,7 @@ DEFINE_ACTION_FUNCTION(_CVar, SetFloat)
|
|||
// Only menus are allowed to change non-mod CVARs.
|
||||
if (DMenu::InMenu == 0)
|
||||
{
|
||||
I_FatalError("Attempt to change CVAR '%s' outside of menu code", self->GetName());
|
||||
ThrowAbortException(X_OTHER, "Attempt to change CVAR '%s' outside of menu code", self->GetName());
|
||||
}
|
||||
}
|
||||
PARAM_FLOAT(val);
|
||||
|
@ -269,7 +269,7 @@ DEFINE_ACTION_FUNCTION(_CVar, SetString)
|
|||
// Only menus are allowed to change non-mod CVARs.
|
||||
if (DMenu::InMenu == 0)
|
||||
{
|
||||
I_FatalError("Attempt to change CVAR '%s' outside of menu code", self->GetName());
|
||||
ThrowAbortException(X_OTHER, "Attempt to change CVAR '%s' outside of menu code", self->GetName());
|
||||
}
|
||||
}
|
||||
PARAM_STRING(val);
|
||||
|
@ -1168,6 +1168,15 @@ void FBaseCVar::ResetToDefault ()
|
|||
DEFINE_ACTION_FUNCTION(_CVar, ResetToDefault)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FBaseCVar);
|
||||
if (!(self->GetFlags() & CVAR_MOD))
|
||||
{
|
||||
// Only menus are allowed to change non-mod CVARs.
|
||||
if (DMenu::InMenu == 0)
|
||||
{
|
||||
ThrowAbortException(X_OTHER, "Attempt to change CVAR '%s' outside of menu code", self->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
self->ResetToDefault();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue