Example #1
0
void ConCommandBase::RevertFlaggedCvars( int flag )
{
	for (const ConCommandBase *var= GetCommands() ; var ; var=var->GetNext())
	{
		if ( var->IsCommand() )
			continue;

		ConVar *cvar = ( ConVar * )var;

		if ( !cvar->IsBitSet( flag ) )
			continue;

		// It's == to the default value, don't count
		if ( !Q_strcasecmp( cvar->GetDefault(), cvar->GetString() ) )
			continue;

		cvar->Revert();

		// DevMsg( "%s = \"%s\" (reverted)\n", cvar->GetName(), cvar->GetString() );
	}
}