]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cvar.c
added lingering blood and gunshot/spike particles to make it clear where
[xonotic/darkplaces.git] / cvar.c
diff --git a/cvar.c b/cvar.c
index 98892d70c9def548eaed4ecae627831205b169c9..7203dee6a996f6219466e820b3fab393afefdc20 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -260,8 +260,14 @@ void Cvar_SetQuick_Internal (cvar_t *var, const char *value)
                // holds weird values it may cause confusion...
                if (!strcmp(var->name, "_cl_color"))
                {
-                       CL_SetInfo("topcolor", va("%i", (var->integer >> 4) & 15), true, false, false, false);
-                       CL_SetInfo("bottomcolor", va("%i", (var->integer) & 15), true, false, false, false);
+                       int top = (var->integer >> 4) & 15, bottom = var->integer & 15;
+                       CL_SetInfo("topcolor", va("%i", top), true, false, false, false);
+                       CL_SetInfo("bottomcolor", va("%i", bottom), true, false, false, false);
+                       if (cls.protocol != PROTOCOL_QUAKEWORLD && cls.netcon)
+                       {
+                               MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
+                               MSG_WriteString(&cls.netcon->message, va("color %i %i", top, bottom));
+                       }
                }
                else if (!strcmp(var->name, "_cl_rate"))
                        CL_SetInfo("rate", va("%i", var->integer), true, false, false, false);
@@ -468,7 +474,7 @@ cvar_t *Cvar_Get (const char *name, const char *value, int flags)
        memcpy(cvar->defstring, value, alloclen);
        cvar->value = atof (cvar->string);
        cvar->integer = (int) cvar->value;
-       cvar->description = "custom cvar";
+       cvar->description = "custom cvar"; // actually checked by VM_cvar_type
 
 // link the variable in
 // alphanumerical order
@@ -666,7 +672,8 @@ void Cvar_Set_f (void)
                return;
        }
 
-       Con_DPrint("Set: ");
+       if (developer.integer >= 100)
+               Con_DPrint("Set: ");
 
        // all looks ok, create/modify the cvar
        Cvar_Get(Cmd_Argv(1), Cmd_Argv(2), 0);
@@ -691,7 +698,8 @@ void Cvar_SetA_f (void)
                return;
        }
 
-       Con_DPrint("SetA: ");
+       if (developer.integer >= 100)
+               Con_DPrint("SetA: ");
 
        // all looks ok, create/modify the cvar
        Cvar_Get(Cmd_Argv(1), Cmd_Argv(2), CVAR_SAVE);