MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / Restart_f

Method Restart_f

neo/framework/CVarSystem.cpp:1237–1261  ·  view source on GitHub ↗

============ idCVarSystemLocal::Restart_f ============ */

Source from the content-addressed store, hash-verified

1235============
1236*/
1237void idCVarSystemLocal::Restart_f( const idCmdArgs &args ) {
1238 int i, hash;
1239 idInternalCVar *cvar;
1240
1241 for ( i = 0; i < localCVarSystem.cvars.Num(); i++ ) {
1242 cvar = localCVarSystem.cvars[i];
1243
1244 // don't mess with rom values
1245 if ( cvar->flags & ( CVAR_ROM | CVAR_INIT ) ) {
1246 continue;
1247 }
1248
1249 // throw out any variables the user created
1250 if ( !( cvar->flags & CVAR_STATIC ) ) {
1251 hash = localCVarSystem.cvarHash.GenerateKey( cvar->nameString, false );
1252 delete cvar;
1253 localCVarSystem.cvars.RemoveIndex( i );
1254 localCVarSystem.cvarHash.RemoveIndex( hash, i );
1255 i--;
1256 continue;
1257 }
1258
1259 cvar->Reset();
1260 }
1261}

Callers

nothing calls this directly

Calls 4

GenerateKeyMethod · 0.80
NumMethod · 0.45
RemoveIndexMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected