diff options
Diffstat (limited to 'src/qcommon')
-rw-r--r-- | src/qcommon/cvar.c | 9 | ||||
-rw-r--r-- | src/qcommon/files.c | 11 | ||||
-rw-r--r-- | src/qcommon/q_shared.h | 4 |
3 files changed, 13 insertions, 11 deletions
diff --git a/src/qcommon/cvar.c b/src/qcommon/cvar.c index 0954e1f6..f71bc74f 100644 --- a/src/qcommon/cvar.c +++ b/src/qcommon/cvar.c @@ -169,10 +169,15 @@ int Cvar_Flags(const char *var_name) { cvar_t *var; - if(! (var = Cvar_FindVar(var_name)) ) + if(!(var = Cvar_FindVar(var_name))) return CVAR_NONEXISTENT; else - return var->flags; + { + if(var->modified) + return var->flags | CVAR_MODIFIED; + else + return var->flags; + } } /* diff --git a/src/qcommon/files.c b/src/qcommon/files.c index 10e00f11..16499a0a 100644 --- a/src/qcommon/files.c +++ b/src/qcommon/files.c @@ -3586,13 +3586,13 @@ void FS_Restart( int checksumFeed ) { /* ================= FS_ConditionalRestart -restart if necessary + +Restart if necessary +Return qtrue if restarting due to game directory changed, qfalse otherwise ================= */ qboolean FS_ConditionalRestart(int checksumFeed, qboolean disconnect) { - int retval; - if(fs_gamedirvar->modified) { if(FS_FilenameCompare(lastValidGame, fs_gamedirvar->string) && @@ -3603,13 +3603,8 @@ qboolean FS_ConditionalRestart(int checksumFeed, qboolean disconnect) return qtrue; } else - { fs_gamedirvar->modified = qfalse; - retval = qtrue; - } } - else - retval = qfalse; if(checksumFeed != fs_checksumFeed) FS_Restart(checksumFeed); diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h index 46a6e4b1..e007ae24 100644 --- a/src/qcommon/q_shared.h +++ b/src/qcommon/q_shared.h @@ -951,7 +951,9 @@ default values. #define CVAR_SERVER_CREATED 0x0800 // cvar was created by a server the client connected to. #define CVAR_VM_CREATED 0x1000 // cvar was created exclusively in one of the VMs. #define CVAR_PROTECTED 0x2000 // prevent modifying this var from VMs or the server -#define CVAR_NONEXISTENT 0xFFFFFFFF // Cvar doesn't exist. +// These flags are only returned by the Cvar_Flags() function +#define CVAR_MODIFIED 0x40000000 // Cvar was modified +#define CVAR_NONEXISTENT 0x80000000 // Cvar doesn't exist. // nothing outside the Cvar_*() functions should modify these fields! typedef struct cvar_s cvar_t; |