[quake3-commits] r1639 - in trunk/code: game qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Oct 3 17:41:23 EDT 2009


Author: thilo
Date: 2009-10-03 17:41:22 -0400 (Sat, 03 Oct 2009)
New Revision: 1639

Modified:
   trunk/code/game/g_client.c
   trunk/code/qcommon/q_shared.h
Log:
Revert back color code change


Modified: trunk/code/game/g_client.c
===================================================================
--- trunk/code/game/g_client.c	2009-10-03 21:15:23 UTC (rev 1638)
+++ trunk/code/game/g_client.c	2009-10-03 21:41:22 UTC (rev 1639)
@@ -632,7 +632,7 @@
 			{
 				colorlessLen--;
 				
-				if(*in == COLOR_BLACK)
+				if(ColorIndex(*in) == 0)
 				{
 					// Disallow color black in names to prevent players
 					// from getting advantage playing in front of black backgrounds

Modified: trunk/code/qcommon/q_shared.h
===================================================================
--- trunk/code/qcommon/q_shared.h	2009-10-03 21:15:23 UTC (rev 1638)
+++ trunk/code/qcommon/q_shared.h	2009-10-03 21:41:22 UTC (rev 1639)
@@ -365,7 +365,7 @@
 extern	vec4_t		colorDkGrey;
 
 #define Q_COLOR_ESCAPE	'^'
-#define Q_IsColorString(p)	((p) && *(p) == Q_COLOR_ESCAPE && *((p)+1) && *((p)+1) >= '0' && *((p)+1) <= '7') // ^[0-9a-zA-Z]
+#define Q_IsColorString(p)	((p) && *(p) == Q_COLOR_ESCAPE && *((p)+1) && isalnum(*((p)+1))) // ^[0-9a-zA-Z]
 
 #define COLOR_BLACK	'0'
 #define COLOR_RED	'1'
@@ -375,7 +375,7 @@
 #define COLOR_CYAN	'5'
 #define COLOR_MAGENTA	'6'
 #define COLOR_WHITE	'7'
-#define ColorIndex(c)	((c) - '0')
+#define ColorIndex(c)	(((c) - '0') & 0x07)
 
 #define S_COLOR_BLACK	"^0"
 #define S_COLOR_RED	"^1"



More information about the quake3-commits mailing list