Пример #1
0
/*
===============
G_IssueMapChange

Send commands to the server to actually change the map
===============
*/
static void G_IssueMapChange( int rotation )
{
  int   i;
  int   map = G_GetCurrentMap( rotation );
  char  cmd[ MAX_TOKEN_CHARS ];

  // allow a manually defined g_layouts setting to override the maprotation
  if( !g_layouts.string[ 0 ] &&
    mapRotations.rotations[ rotation ].maps[ map ].layouts[ 0 ] )
  {
    trap_Cvar_Set( "g_layouts",
      mapRotations.rotations[ rotation ].maps[ map ].layouts );
  }

  trap_SendConsoleCommand( EXEC_APPEND, va( "map %s\n",
    mapRotations.rotations[ rotation ].maps[ map ].name ) );

  // load up map defaults if g_mapConfigs is set
  G_MapConfigs( mapRotations.rotations[ rotation ].maps[ map ].name );

  for( i = 0; i < mapRotations.rotations[ rotation ].maps[ map ].numCmds; i++ )
  {
    Q_strncpyz( cmd, mapRotations.rotations[ rotation ].maps[ map ].postCmds[ i ],
                sizeof( cmd ) );
    Q_strcat( cmd, sizeof( cmd ), "\n" );
    trap_SendConsoleCommand( EXEC_APPEND, cmd );
  }
}
Пример #2
0
/*
===============
G_IssueMapChange

Send commands to the server to actually change the map
===============
*/
static void G_IssueMapChange( int rotation )
{
  int   i;
  int   map = G_GetCurrentMap( rotation );
  char  cmd[ MAX_TOKEN_CHARS ];
  char  newmap[ MAX_CVAR_VALUE_STRING ];

  Q_strncpyz( newmap, mapRotations.rotations[rotation].maps[map].name, sizeof( newmap ));

  if (!Q_stricmp( newmap, "*VOTE*") )
  {
    fileHandle_t f;

    G_GetVotedMap( newmap, sizeof( newmap ), rotation, map );
    if( trap_FS_FOpenFile( va("maps/%s.bsp", newmap), &f, FS_READ ) > 0 )
    {
      trap_FS_FCloseFile( f );
    }
    else
    {
      G_AdvanceMapRotation();
      return;
    }
  }

  // allow a manually defined g_layouts setting to override the maprotation
  if( !g_layouts.string[ 0 ] &&
    mapRotations.rotations[ rotation ].maps[ map ].layouts[ 0 ] )
  {
    trap_Cvar_Set( "g_layouts",
      mapRotations.rotations[ rotation ].maps[ map ].layouts );
  }

  trap_SendConsoleCommand( EXEC_APPEND, va( "map %s\n", newmap ) );

  // load up map defaults if g_mapConfigs is set
  G_MapConfigs( newmap );

  for( i = 0; i < mapRotations.rotations[ rotation ].maps[ map ].numCmds; i++ )
  {
    Q_strncpyz( cmd, mapRotations.rotations[ rotation ].maps[ map ].postCmds[ i ],
                sizeof( cmd ) );
    Q_strcat( cmd, sizeof( cmd ), "\n" );
    trap_SendConsoleCommand( EXEC_APPEND, cmd );
  }
}
Пример #3
0
/*
===============
G_IssueMapChange

Send commands to the server to actually change the map
===============
*/
static void G_IssueMapChange( int index, int rotation )
{
	node_t *node = mapRotations.rotations[ rotation ].nodes[ index ];
	map_t  *map = &node->u.map;

	// allow a manually defined g_layouts setting to override the maprotation
	if ( !g_layouts.string[ 0 ] && map->layouts[ 0 ] )
	{
		trap_Cvar_Set( "g_layouts", map->layouts );
	}

	trap_SendConsoleCommand( EXEC_APPEND, va( "map %s\n", map->name ) );

	// Load up map defaults if g_mapConfigs is set
	G_MapConfigs( map->name );

	if ( strlen( map->postCommand ) > 0 )
	{
		trap_SendConsoleCommand( EXEC_APPEND, map->postCommand );
	}
}