r3098 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Jan 4 07:26:40 EST 2008


Author: div0
Date: 2008-01-04 07:26:39 -0500 (Fri, 04 Jan 2008)
New Revision: 3098

Modified:
   trunk/data/qcsrc/server/clientcommands.qc
Log:
untested support for a spectator team for teamsay


Modified: trunk/data/qcsrc/server/clientcommands.qc
===================================================================
--- trunk/data/qcsrc/server/clientcommands.qc	2008-01-04 07:08:35 UTC (rev 3097)
+++ trunk/data/qcsrc/server/clientcommands.qc	2008-01-04 12:26:39 UTC (rev 3098)
@@ -20,17 +20,16 @@
 	if(msgin == "")
 		return;
 
-	colorstr = Team_ColorCode(source.team);
-
-	if(!teams_matter)
+	if(source.classname != "player")
+		colorstr = "^0"; // black for spectators
+	else if(teams_matter)
+		colorstr = Team_ColorCode(source.team);
+	else
 		teamsay = FALSE;
 
 	if(intermission_running)
 		teamsay = FALSE;
 
-	if(source.classname != "player") // observers can't
-		teamsay = FALSE;
-
 	/*
 	 * using bprint solves this... me stupid
 	// how can we prevent the message from appearing in a listen server?
@@ -102,10 +101,21 @@
 	}
 	else if(teamsay)
 	{
-		FOR_EACH_REALPLAYER(head)
+		if(source.classname == "player")
 		{
-			if(head.team == source.team)
+			FOR_EACH_REALPLAYER(head)
 			{
+				if(head.team == source.team)
+				{
+					sprint(head, msgstr);
+					centerprint(head, cmsgstr);
+				}
+			}
+		}
+		else
+		{
+			FOR_EACH_REALCLIENT(head) if(head.classname != "player")
+			{
 				sprint(head, msgstr);
 				centerprint(head, cmsgstr);
 			}




More information about the nexuiz-commits mailing list