summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qcommon/cvar.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/qcommon/cvar.c b/src/qcommon/cvar.c
index 1ddac15a..84d6ac5a 100644
--- a/src/qcommon/cvar.c
+++ b/src/qcommon/cvar.c
@@ -335,6 +335,18 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) {
{
var_value = Cvar_Validate(var, var_value, qfalse);
+ // Make sure the game code cannot mark engine-added variables as gamecode vars
+ if(var->flags & CVAR_VM_CREATED)
+ {
+ if(!(flags & CVAR_VM_CREATED))
+ var->flags &= ~CVAR_VM_CREATED;
+ }
+ else if (!(var->flags & CVAR_USER_CREATED))
+ {
+ if(flags & CVAR_VM_CREATED)
+ flags &= ~CVAR_VM_CREATED;
+ }
+
// if the C code is now specifying a variable that the user already
// set a value for, take the new value as the reset value
if(var->flags & CVAR_USER_CREATED)
@@ -355,18 +367,6 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) {
}
}
- // Make sure the game code cannot mark engine-added variables as gamecode vars
- if(var->flags & CVAR_VM_CREATED)
- {
- if(!(flags & CVAR_VM_CREATED))
- var->flags &= ~CVAR_VM_CREATED;
- }
- else
- {
- if(flags & CVAR_VM_CREATED)
- flags &= ~CVAR_VM_CREATED;
- }
-
// Make sure servers cannot mark engine-added variables as SERVER_CREATED
if(var->flags & CVAR_SERVER_CREATED)
{