<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">[PATCH] Check if protected cvar changed before printing warning

The code I added to make some cvars protected by the developer cvar
causes an undesirable side effect when using the Omicron bot. The code
there seems to want to set "r_fullbright 0" every frame as some kind
of cheat protection. This caused my code to spam the console.

diff -urN a/common/cvar.c head/common/cvar.c
--- a/common/cvar.c	2006-02-19 15:16:34.000000000 +1030
+++ head/common/cvar.c	2006-02-19 14:15:47.000000000 +1030
@@ -109,7 +109,8 @@
     qboolean changed;
 
     var = Cvar_FindVar(var_name);
-    if (!var) {			// there is an error in C code if this happens
+    if (!var) {
+	/* there is an error in C code if this happens */
 	Con_Printf("Cvar_Set: variable %s not found\n", var_name);
 	return;
     }
@@ -119,14 +120,14 @@
 	return;
     }
 
+    changed = strcmp(var-&gt;string, value);
+
     /* Check for developer-only cvar */
-    if ((var-&gt;flags &amp; CVAR_DEVELOPER) &amp;&amp; !developer.value) {
+    if (changed &amp;&amp; (var-&gt;flags &amp; CVAR_DEVELOPER) &amp;&amp; !developer.value) {
 	Con_Printf("%s is settable only in developer mode.\n", var_name);
 	return;
     }
 
-    changed = strcmp(var-&gt;string, value);
-
 #ifdef SERVERONLY
     if (var-&gt;info) {
 	Info_SetValueForKey(svs.info, var_name, value, MAX_SERVERINFO_STRING);
</pre></body></html>