
Untitled
By: a guest on
Aug 1st, 2011 | syntax:
Diff | size: 2.75 KB | hits: 51 | expires: Never
diff -Nau wolfcamql-src-orig/code/cgame/cg_consolecmds.c wolfcamql-src/code/cgame/cg_consolecmds.c
--- wolfcamql-src-orig/code/cgame/cg_consolecmds.c 2011-07-25 22:57:17.000000000 +0200
+++ wolfcamql-src/code/cgame/cg_consolecmds.c 2011-08-01 22:02:57.849691248 +0200
@@ -3695,6 +3695,7 @@
#define T_ENEMY -1
#define T_ALL -2
+#define T_MATES -3
// silence compiler warning
memset(headColor, 0, sizeof(headColor));
@@ -3737,7 +3738,8 @@
}
if (CG_Argc() < 4) {
- Com_Printf("\nusage: clientoverride <client number or 'red', 'blue', 'enemy', 'all', 'clear'> <key name> <key value> ... with additional key and value pairs as needed\n");
+ Com_Printf("\nusage: clientoverride <client number or 'red', 'blue', 'enemy', 'all', 'clear', 'mates', 'us'>"
+ " <key name> <key value> ... with additional key and value pairs as needed\n");
Com_Printf("\nexample: clientoverride 3 model ranger hmodel bones\n\n");
return;
}
@@ -3755,6 +3757,12 @@
} else if (!Q_stricmp("all", CG_Argv(1))) {
useTeam = qtrue;
team = T_ALL;
+ } else if (!Q_stricmp("mates", CG_Argv(1))) {
+ useTeam = qtrue;
+ team = T_MATES;
+ } else if (!Q_stricmp("us", CG_Argv(1))) {
+ useTeam = qfalse;
+ clientNum = cg.snap->ps.clientNum;
} else {
useTeam = qfalse;
clientNum = atoi(CG_Argv(1));
@@ -3764,20 +3772,20 @@
}
}
+ if (useTeam) {
+ start = 0;
+ end = MAX_CLIENTS;
+ } else {
+ start = clientNum;
+ end = start + 1;
+ }
+
for (i = 2; i < CG_Argc(); i += 2) {
Q_strncpyz(key, CG_Argv(i), sizeof(key));
Q_strncpyz(value, CG_Argv(i + 1), sizeof(value));
Com_Printf("key: %s value: %s\n", key, value);
- if (useTeam) {
- start = 0;
- end = MAX_CLIENTS;
- } else {
- start = clientNum;
- end = start + 1;
- }
-
for (j = start; j < end; j++) {
int t;
@@ -3786,16 +3794,15 @@
if (!clientInfoString[0]) {
continue;
}
+
+ ci = &cgs.clientinfo[j];
+
if (useTeam) {
t = atoi(Info_ValueForKey(clientInfoString, "t"));
switch (team) {
case TEAM_RED:
- if (t != TEAM_RED) {
- continue;
- }
- break;
case TEAM_BLUE:
- if (t != TEAM_BLUE) {
+ if (t != team) {
continue;
}
break;
@@ -3808,11 +3815,15 @@
break;
case T_ALL:
break;
+ case T_MATES:
+ if (j == cg.snap->ps.clientNum || !CG_IsTeammate(ci))
+ continue;
+ break;
default:
continue;
}
}
- ci = &cgs.clientinfo[j];
+
if (clientInfoString[0] != '\\') {
buffer[0] = '\\';
Q_strncpyz(buffer + 1, clientInfoString, sizeof(buffer) - 1);
@@ -3964,6 +3975,7 @@
#undef T_ENEMY
#undef T_ALL
+#undef T_MATES
}
static void CG_TestMenu_f (void)