Made unsafe execution context check for CVARs more strict
This prevents changing of non-mod CVARs from unsafe context for various code paths including set and toggle CCMDs
This commit is contained in:
parent
c7eea9b480
commit
1e9fdca755
3 changed files with 8 additions and 9 deletions
|
|
@ -53,6 +53,7 @@
|
|||
#include "colormatcher.h"
|
||||
#include "menu/menu.h"
|
||||
#include "vm.h"
|
||||
#include "v_text.h"
|
||||
|
||||
struct FLatchedValue
|
||||
{
|
||||
|
|
@ -156,6 +157,11 @@ void FBaseCVar::SetGenericRep (UCVarValue value, ECVarType type)
|
|||
{
|
||||
return;
|
||||
}
|
||||
else if (UnsafeExecutionContext && !(GetFlags() & CVAR_MOD))
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Cannot set console variable" TEXTCOLOR_GOLD " %s " TEXTCOLOR_RED "from unsafe command\n", GetName());
|
||||
return;
|
||||
}
|
||||
else if ((Flags & CVAR_LATCH) && gamestate != GS_FULLCONSOLE && gamestate != GS_STARTUP)
|
||||
{
|
||||
FLatchedValue latch;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue