From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Fri, 16 Mar 2007 09:34:24 +0000 (+0000)
Subject: fixed bug where every name/color/playermodel/playerskin/etc property change was sent... 
X-Git-Tag: xonotic-v0.1.0preview~3427
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a7cc13d2f12eedcaa354066f531fb1529e204784;p=xonotic%2Fdarkplaces.git

fixed bug where every name/color/playermodel/playerskin/etc property change was sent twice
removed some autodemo code


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6990 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/cvar.c b/cvar.c
index 98892d70..beee7212 100644
--- 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);
diff --git a/host_cmd.c b/host_cmd.c
index e954d15e..4dcc0e5d 100644
--- a/host_cmd.c
+++ b/host_cmd.c
@@ -269,29 +269,6 @@ void Host_Map_f (void)
 	SV_SpawnServer(level);
 	if (sv.active && cls.state == ca_disconnected)
 		CL_EstablishConnection("local:1");
-
-#ifdef AUTODEMO_BROKEN
-// if cl_autodemo is set, automatically start recording a demo if one isn't being recorded already
-	if (cl_autodemo.integer && !cls.demorecording)
-	{
-		char demofile[MAX_OSPATH];
-
-		dpsnprintf (demofile, sizeof(demofile), "%s_%s.dem", Sys_TimeString (cl_autodemo_nameformat.string), level);
-
-		Con_Printf ("Recording to %s.\n", demofile);
-
-		cls.demofile = FS_Open (demofile, "wb", false, false);
-		if (cls.demofile)
-		{
-			cls.forcetrack = -1;
-			FS_Printf (cls.demofile, "%i\n", cls.forcetrack);
-		}
-		else
-			Con_Print ("ERROR: couldn't open.\n");
-
-		cls.demorecording = true;
-	}
-#endif
 }
 
 /*
@@ -781,7 +758,6 @@ void Host_Name_f (void)
 	if (cmd_source == src_command)
 	{
 		Cvar_Set ("_cl_name", newName);
-		CL_SetInfo("name", newName, true, false, false, false);
 		return;
 	}
 
@@ -839,7 +815,6 @@ void Host_Playermodel_f (void)
 	if (cmd_source == src_command)
 	{
 		Cvar_Set ("_cl_playermodel", newPath);
-		CL_SetInfo("playermodel", newPath, true, false, false, false);
 		return;
 	}
 
@@ -897,7 +872,6 @@ void Host_Playerskin_f (void)
 	if (cmd_source == src_command)
 	{
 		Cvar_Set ("_cl_playerskin", newPath);
-		CL_SetInfo("playerskin", newPath, true, false, false, false);
 		return;
 	}
 
@@ -1167,15 +1141,6 @@ void Host_Color(int changetop, int changebottom)
 	if (cmd_source == src_command)
 	{
 		Cvar_SetValueQuick(&cl_color, playercolor);
-		if (changetop >= 0)
-			CL_SetInfo("topcolor", va("%i", top), true, false, false, false);
-		if (changebottom >= 0)
-			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));
-		}
 		return;
 	}
 
@@ -1273,7 +1238,6 @@ void Host_Rate_f(void)
 	if (cmd_source == src_command)
 	{
 		Cvar_SetValue ("_cl_rate", max(NET_MINRATE, rate));
-		CL_SetInfo("rate", va("%i", rate), true, false, false, false);
 		return;
 	}