In
cvar_change, you can actually replace this type of check:
Code:
if (StrEqual(cvarname, "lilac_enable", false)) {
icvar[CVAR_ENABLE] = StringToInt(newValue, 10);
} else if (StrEqual(cvarname, "lilac_sourcebans", false)) {
icvar[CVAR_SB] = StringToInt(newValue, 10);
to:
Code:
if ( convar == hCvar[CVAR_ENABLE] ) { // Store ConVar handles globally as Handle or ConVar (on new syntax) -typed
icvar[CVAR_ENABLE] = StringToInt(newValue, 10);
} else if ( convar == hCvar[CVAR_SB] ) {
icvar[CVAR_SB] = StringToInt(newValue, 10);
// etc...
// The thing is that ConVar Handle is never changed after creating so you don't need to check for convar name
// just directly check convar handle
Also, you should probably add translation support for hardcoded messages.
__________________