本文整理汇总了C++中CTeamControlPointMaster::SetLastOwnershipChangeTime方法的典型用法代码示例。如果您正苦于以下问题:C++ CTeamControlPointMaster::SetLastOwnershipChangeTime方法的具体用法?C++ CTeamControlPointMaster::SetLastOwnershipChangeTime怎么用?C++ CTeamControlPointMaster::SetLastOwnershipChangeTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTeamControlPointMaster
的用法示例。
在下文中一共展示了CTeamControlPointMaster::SetLastOwnershipChangeTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InternalSetOwner
//.........这里部分代码省略.........
if ( GetModelPtr() && GetModelPtr()->SequencesAvailable() )
{
m_TeamData[i].iTeamPoseParam = LookupPoseParameter( UTIL_VarArgs( "cappoint_%d_percentage", i ) );
}
else
{
m_TeamData[i].iTeamPoseParam = -1;
}
}
UpdateCapPercentage();
if ( m_iTeam == TEAM_UNASSIGNED )
{
m_OnCapReset.FireOutput( this, this );
}
else
{
// Remap team to get first game team = 1
switch ( m_iTeam - FIRST_GAME_TEAM+1 )
{
case 1:
m_OnCapTeam1.FireOutput( this, this );
break;
case 2:
m_OnCapTeam2.FireOutput( this, this );
break;
default:
Assert(0);
break;
}
}
// If we're playing a sound, this is a true cap by players.
if ( bMakeSound )
{
if ( iOldTeam > LAST_SHARED_TEAM && iOldTeam != m_iTeam )
{
// Make the members of our old team say something
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBaseMultiplayerPlayer *pPlayer = ToBaseMultiplayerPlayer( UTIL_PlayerByIndex( i ) );
if ( !pPlayer )
continue;
if ( pPlayer->GetTeamNumber() == iOldTeam )
{
pPlayer->SpeakConceptIfAllowed( MP_CONCEPT_LOST_CONTROL_POINT );
}
}
}
for( int i = 0; i < iNumCappers; i++ )
{
int playerIndex = pCappingPlayers[i];
Assert( playerIndex > 0 && playerIndex <= gpGlobals->maxClients );
CBaseMultiplayerPlayer *pPlayer = ToBaseMultiplayerPlayer( UTIL_PlayerByIndex( playerIndex ) );
PlayerCapped( pPlayer );
#ifdef TF_DLL
if ( TFGameRules() && TFGameRules()->IsHolidayActive( kHoliday_EOTL ) )
{
TFGameRules()->DropBonusDuck( pPlayer->GetAbsOrigin(), ToTFPlayer( pPlayer ), NULL, NULL, false, true );
}
#endif
}
// Remap team to get first game team = 1
switch ( m_iTeam - FIRST_GAME_TEAM+1 )
{
case 1:
m_OnOwnerChangedToTeam1.FireOutput( this, this );
break;
case 2:
m_OnOwnerChangedToTeam2.FireOutput( this, this );
break;
}
if ( m_iTeam != TEAM_UNASSIGNED && iNumCappers )
{
SendCapString( m_iTeam, iNumCappers, pCappingPlayers );
}
}
// Have control point master check the win conditions now!
CBaseEntity *pEnt = gEntList.FindEntityByClassname( NULL, GetControlPointMasterName() );
while( pEnt )
{
CTeamControlPointMaster *pMaster = dynamic_cast<CTeamControlPointMaster *>( pEnt );
if ( pMaster->IsActive() )
{
pMaster->CheckWinConditions();
pMaster->SetLastOwnershipChangeTime( gpGlobals->curtime );
}
pEnt = gEntList.FindEntityByClassname( pEnt, GetControlPointMasterName() );
}
}