Cvar_UpdateAutoCvar(var);
}
+void Cvar_Callback(cvar_t *var)
+{
+ if (var == NULL)
+ {
+ Con_Print("Cvar_Callback: var == NULL\n");
+ return;
+ }
+
+ if(var->callback)
+ var->callback(var);
+}
+
/*
============
Cvar_Set
Cvar_UpdateAutoCvar(var);
// Call the function stored in the cvar for bounds checking, cleanup, etc
- if (var->callback)
- var->callback(var);
+ Cvar_Callback(var);
}
void Cvar_SetQuick (cvar_t *var, const char *value)
void Cvar_RegisterCallback(cvar_t *variable, void (*callback)(cvar_t *))
{
+ if (variable == NULL)
+ {
+ Con_Print("Cvar_RegisterCallback: var == NULL\n");
+ return;
+ }
variable->callback = callback;
}
qbool Cvar_Readonly (cvar_t *var, const char *cmd_name);
+void Cvar_Callback(cvar_t *var);
+
/// equivelant to "<name> <variable>" typed at the console
void Cvar_Set (cvar_state_t *cvars, const char *var_name, const char *value);