MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Cvar_SetCheatState

Function Cvar_SetCheatState

code/qcommon/cvar.cpp:762–780  ·  view source on GitHub ↗

============ Cvar_SetCheatState Any testing variables will be reset to the safe values ============ */

Source from the content-addressed store, hash-verified

760============
761*/
762void Cvar_SetCheatState( void ) {
763 cvar_t *var;
764
765 // set all default vars to the safe value
766 for ( var = cvar_vars ; var ; var = var->next ) {
767 if ( var->flags & CVAR_CHEAT ) {
768 // the CVAR_LATCHED|CVAR_CHEAT vars might escape the reset here
769 // because of a different var->latchedString
770 if (var->latchedString)
771 {
772 Cvar_FreeString(var->latchedString);
773 var->latchedString = NULL;
774 }
775 if (strcmp(var->resetString,var->string)) {
776 Cvar_Set( var->name, var->resetString );
777 }
778 }
779 }
780}
781
782/*
783============

Callers 2

CL_SystemInfoChangedFunction · 0.50
CL_InitCGameFunction · 0.50

Calls 2

Cvar_FreeStringFunction · 0.70
Cvar_SetFunction · 0.70

Tested by

no test coverage detected