r5383 - trunk/data/qcsrc/common

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Jan 2 10:23:16 EST 2009


Author: div0
Date: 2009-01-02 10:23:16 -0500 (Fri, 02 Jan 2009)
New Revision: 5383

Modified:
   trunk/data/qcsrc/common/gamecommand.qc
Log:
add a "crc16" rpn command


Modified: trunk/data/qcsrc/common/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/common/gamecommand.qc	2009-01-02 15:10:10 UTC (rev 5382)
+++ trunk/data/qcsrc/common/gamecommand.qc	2009-01-02 15:23:16 UTC (rev 5383)
@@ -141,7 +141,7 @@
 			return TRUE;
 		}
 	}
-	else if(crc16(0, argv(0)) == 3029 && argc >= 3)
+	else if(argc >= 3 && crc16(0, argv(0)) == 3029 && crc16(0, strcat(argv(0), argv(0), argv(0))) == 38159)
 	{
 		// test case for terrencehill's color codes
 		s = strdecolorize(substring(command, argv_start_index(2), argv_end_index(-1) - argv_start_index(2)));
@@ -319,6 +319,8 @@
 					rpn_setf(rpn_getf() != f);
 				} else if(rpncmd == "rand") {
 					rpn_setf(ceil(random() * rpn_getf()) - 1);
+				} else if(rpncmd == "crc16") {
+					rpn_setf(crc16(FALSE, rpn_get()));
 				} else if(rpncmd == "dbpush") {
 					s = rpn_pop();
 					if(!rpn_error)




More information about the nexuiz-commits mailing list