home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 March / maximum-cd-2000-03.iso / Quake3 Game Source / Q3AGameSource.exe / Main / ui_sparena.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-18  |  759 b   |  31 lines

  1. // Copyright (C) 1999-2000 Id Software, Inc.
  2. //
  3. #include "ui_local.h"
  4.  
  5. void UI_SPArena_Start( const char *arenaInfo ) {
  6.     char    *map;
  7.     int        level;
  8.     int        n;
  9.     char    *txt;
  10.  
  11.     n = (int)trap_Cvar_VariableValue( "sv_maxclients" );
  12.     if ( n < 8 ) {
  13.         trap_Cvar_SetValue( "sv_maxclients", 8 );
  14.     }
  15.  
  16.     level = atoi( Info_ValueForKey( arenaInfo, "num" ) );
  17.     txt = Info_ValueForKey( arenaInfo, "special" );
  18.     if( txt[0] ) {
  19.         if( Q_stricmp( txt, "training" ) == 0 ) {
  20.             level = -4;
  21.         }
  22.         else if( Q_stricmp( txt, "final" ) == 0 ) {
  23.             level = UI_GetNumSPTiers() * ARENAS_PER_TIER;
  24.         }
  25.     }
  26.     trap_Cvar_SetValue( "ui_spSelection", level );
  27.  
  28.     map = Info_ValueForKey( arenaInfo, "map" );
  29.     trap_Cmd_ExecuteText( EXEC_APPEND, va( "spmap %s\n", map ) );
  30. }
  31.