Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 1st, 2011  |  syntax: Diff  |  size: 2.75 KB  |  hits: 51  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -Nau wolfcamql-src-orig/code/cgame/cg_consolecmds.c wolfcamql-src/code/cgame/cg_consolecmds.c
  2. --- wolfcamql-src-orig/code/cgame/cg_consolecmds.c      2011-07-25 22:57:17.000000000 +0200
  3. +++ wolfcamql-src/code/cgame/cg_consolecmds.c   2011-08-01 22:02:57.849691248 +0200
  4. @@ -3695,6 +3695,7 @@
  5.  
  6.  #define T_ENEMY -1
  7.  #define T_ALL -2
  8. +#define T_MATES -3
  9.  
  10.         // silence compiler warning
  11.         memset(headColor, 0, sizeof(headColor));
  12. @@ -3737,7 +3738,8 @@
  13.         }
  14.  
  15.         if (CG_Argc() < 4) {
  16. -               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");
  17. +               Com_Printf("\nusage:  clientoverride <client number or 'red', 'blue', 'enemy', 'all', 'clear', 'mates', 'us'>"
  18. +               " <key name> <key value> ... with additional key and value pairs as needed\n");
  19.                 Com_Printf("\nexample:  clientoverride 3 model ranger hmodel bones\n\n");
  20.                 return;
  21.         }
  22. @@ -3755,6 +3757,12 @@
  23.         } else if (!Q_stricmp("all", CG_Argv(1))) {
  24.                 useTeam = qtrue;
  25.                 team = T_ALL;
  26. +       } else if (!Q_stricmp("mates", CG_Argv(1))) {
  27. +               useTeam = qtrue;
  28. +               team = T_MATES;
  29. +       } else if (!Q_stricmp("us", CG_Argv(1))) {
  30. +               useTeam = qfalse;
  31. +               clientNum = cg.snap->ps.clientNum;
  32.         } else {
  33.                 useTeam = qfalse;
  34.                 clientNum = atoi(CG_Argv(1));
  35. @@ -3764,20 +3772,20 @@
  36.                 }
  37.         }
  38.  
  39. +       if (useTeam) {
  40. +               start = 0;
  41. +               end = MAX_CLIENTS;
  42. +       } else {
  43. +               start = clientNum;
  44. +               end = start + 1;
  45. +       }
  46. +
  47.         for (i = 2;  i < CG_Argc();  i += 2) {
  48.                 Q_strncpyz(key, CG_Argv(i), sizeof(key));
  49.                 Q_strncpyz(value, CG_Argv(i + 1), sizeof(value));
  50.  
  51.                 Com_Printf("key: %s  value: %s\n", key, value);
  52.  
  53. -               if (useTeam) {
  54. -                       start = 0;
  55. -                       end = MAX_CLIENTS;
  56. -               } else {
  57. -                       start = clientNum;
  58. -                       end = start + 1;
  59. -               }
  60. -
  61.                 for (j = start;  j < end;  j++) {
  62.                         int t;
  63.  
  64. @@ -3786,16 +3794,15 @@
  65.                         if (!clientInfoString[0]) {
  66.                                 continue;
  67.                         }
  68. +
  69. +                       ci = &cgs.clientinfo[j];
  70. +
  71.                         if (useTeam) {
  72.                                 t = atoi(Info_ValueForKey(clientInfoString, "t"));
  73.                                 switch (team) {
  74.                                 case TEAM_RED:
  75. -                                       if (t != TEAM_RED) {
  76. -                                               continue;
  77. -                                       }
  78. -                                       break;
  79.                                 case TEAM_BLUE:
  80. -                                       if (t != TEAM_BLUE) {
  81. +                                       if (t != team) {
  82.                                                 continue;
  83.                                         }
  84.                                         break;
  85. @@ -3808,11 +3815,15 @@
  86.                                         break;
  87.                                 case T_ALL:
  88.                                         break;
  89. +                               case T_MATES:
  90. +                                       if (j == cg.snap->ps.clientNum || !CG_IsTeammate(ci))
  91. +                                               continue;
  92. +                                       break;
  93.                                 default:
  94.                                         continue;
  95.                                 }
  96.                         }
  97. -                       ci = &cgs.clientinfo[j];
  98. +
  99.                         if (clientInfoString[0] != '\\') {
  100.                                 buffer[0] = '\\';
  101.                                 Q_strncpyz(buffer + 1, clientInfoString, sizeof(buffer) - 1);
  102. @@ -3964,6 +3975,7 @@
  103.  
  104.  #undef T_ENEMY
  105.  #undef T_ALL
  106. +#undef T_MATES
  107.  }
  108.  
  109.  static void CG_TestMenu_f (void)