Пример #1
0
CHL2MPRules::CHL2MPRules()
{
#ifndef CLIENT_DLL
    // Create the team managers
    for ( int i = 0; i < ARRAYSIZE( sTeamNames ); i++ )
    {
        CTeam *pTeam = static_cast<CTeam*>(CreateEntityByName( "team_manager" ));
        pTeam->Init( sTeamNames[i], i );

        g_Teams.AddToTail( pTeam );
    }

    m_bTeamPlayEnabled = teamplay.GetBool();
    m_flIntermissionEndTime = 0.0f;
    m_flGameStartTime = 0;

    m_hRespawnableItemsAndWeapons.RemoveAll();
    m_tmNextPeriodicThink = 0;
    m_flRestartGameTime = 0;
    m_bCompleteReset = false;
    m_bHeardAllPlayersReady = false;
    m_bAwaitingReadyRestart = false;
    m_bChangelevelDone = false;

#endif
}
Пример #2
0
CTeam* CTeamMgr::AddTeam(uint32 dwTeamID, char* sTeamName, uint32 dwFlags)
{
	// Make sure this team doesn't already exist...

	if (GetTeam(dwTeamID)) return(NULL);
	if (GetTeam(sTeamName)) return(NULL);


	// Create and init a new team...

	CTeam* pTeam = debug_new(CTeam);
	if (!pTeam) return(NULL);

	if (!pTeam->Init(dwTeamID, sTeamName, dwFlags))
	{
		debug_delete(pTeam);
		return(NULL);
	}


	// Add the new team to our list...

	m_lsTeams.InsertLast(pTeam);


	// All done...

	return(pTeam);
}
Пример #3
0
void CSDKGameRules::InitTeams( void )
{
	Assert( g_Teams.Count() == 0 );

	g_Teams.Purge();	// just in case

#if defined ( SDK_USE_PLAYERCLASSES )
	// clear the player class data
	ResetFilePlayerClassInfoDatabase();
#endif // SDK_USE_PLAYERCLASSES

	// Create the team managers

	//Tony; we have a special unassigned team incase our mod is using classes but not teams.
	CTeam *pUnassigned = static_cast<CTeam*>(CreateEntityByName( "sdk_team_unassigned" ));
	Assert( pUnassigned );
	pUnassigned->Init( pszTeamNames[TEAM_UNASSIGNED], TEAM_UNASSIGNED );
	g_Teams.AddToTail( pUnassigned );

	//Tony; just use a plain ole sdk_team_manager for spectators
	CTeam *pSpectator = static_cast<CTeam*>(CreateEntityByName( "sdk_team_manager" ));
	Assert( pSpectator );
	pSpectator->Init( pszTeamNames[TEAM_SPECTATOR], TEAM_SPECTATOR );
	g_Teams.AddToTail( pSpectator );

	//Tony; don't create these two managers unless teams are being used!
#if defined ( SDK_USE_TEAMS )
	//Tony; create the blue team
	CTeam *pBlue = static_cast<CTeam*>(CreateEntityByName( "sdk_team_blue" ));
	Assert( pBlue );
	pBlue->Init( pszTeamNames[SDK_TEAM_BLUE], SDK_TEAM_BLUE );
	g_Teams.AddToTail( pBlue );

	//Tony; create the red team
	CTeam *pRed = static_cast<CTeam*>(CreateEntityByName( "sdk_team_red" ));
	Assert( pRed );
	pRed->Init( pszTeamNames[SDK_TEAM_RED], SDK_TEAM_RED );
	g_Teams.AddToTail( pRed );
#else
	CTeam *pDeathmatch = static_cast<CTeam*>(CreateEntityByName( "sdk_team_deathmatch" ));
	Assert( pDeathmatch );
	pDeathmatch->Init( pszTeamNames[SDK_TEAM_BLUE], SDK_TEAM_BLUE );
	g_Teams.AddToTail( pDeathmatch );
#endif
}
Пример #4
0
	CSDKGameRules::CSDKGameRules()
	{
		// Create the team managers
		for ( int i = 0; i < static_cast<int>(ARRAYSIZE( sTeamNames )); i++ )
		{
			CTeam *pTeam = static_cast<CTeam*>(CreateEntityByName( "sdk_team_manager" ));
			pTeam->Init( sTeamNames[i], i );

			g_Teams.AddToTail( pTeam );
		}
	}
Пример #5
0
CTFCGameRules::CTFCGameRules()
{
	CTF_Map = true;

#ifdef GAME_DLL
	// Create the team managers
	for ( int i = 0; i < ARRAYSIZE( teamnames ); i++ )
	{
		CTeam *pTeam = static_cast<CTeam*>(CreateEntityByName( "tfc_team_manager" ));
		pTeam->Init( teamnames[i], i );

		g_Teams.AddToTail( pTeam );
	}
#endif
}