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

Function Cvar_Restart

code/qcommon/cvar.cpp:1195–1219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1193*/
1194
1195void Cvar_Restart(qboolean unsetVM)
1196{
1197 cvar_t *curvar;
1198
1199 curvar = cvar_vars;
1200
1201 while(curvar)
1202 {
1203 if((curvar->flags & CVAR_USER_CREATED) ||
1204 (unsetVM && (curvar->flags & CVAR_VM_CREATED)))
1205 {
1206 // throw out any variables the user/vm created
1207 curvar = Cvar_Unset(curvar);
1208 continue;
1209 }
1210
1211 if(!(curvar->flags & (CVAR_ROM | CVAR_INIT | CVAR_NORESTART)))
1212 {
1213 // Just reset the rest to their default values.
1214 Cvar_Set2(curvar->name, curvar->resetString, qfalse);
1215 }
1216
1217 curvar = curvar->next;
1218 }
1219}
1220
1221/*
1222============

Callers 1

Cvar_Restart_fFunction · 0.70

Calls 2

Cvar_UnsetFunction · 0.70
Cvar_Set2Function · 0.70

Tested by

no test coverage detected