本文整理汇总了C++中CHandle::FinishAct方法的典型用法代码示例。如果您正苦于以下问题:C++ CHandle::FinishAct方法的具体用法?C++ CHandle::FinishAct怎么用?C++ CHandle::FinishAct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHandle
的用法示例。
在下文中一共展示了CHandle::FinishAct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartAct
//-----------------------------------------------------------------------------
// Purpose: The act has started
//-----------------------------------------------------------------------------
void CInfoAct::StartAct( void )
{
// FIXME: Should this change?
// Don't allow two simultaneous acts
if (g_hCurrentAct)
{
g_hCurrentAct->FinishAct( );
}
// Set the global act to this
g_hCurrentAct = this;
m_flActStartedAt = gpGlobals->curtime;
m_OnStarted.FireOutput( this, this );
// Do we have a timelimit?
if ( m_flActTimeLimit )
{
SetNextThink( gpGlobals->curtime + m_flActTimeLimit );
SetThink( ActThink );
}
SetUpRespawnTimers();
// Tell all the clients
CRelieableBroadcastRecipientFilter filter;
UserMessageBegin( filter, "ActBegin" );
WRITE_BYTE( (byte)m_iActNumber );
WRITE_FLOAT( m_flActStartedAt );
MessageEnd();
// If we're not an intermission, clean up
if ( !HasSpawnFlags( SF_ACT_INTERMISSION ) )
{
CleanupOnActStart();
}
// Cycle through all players and start the act
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBaseTFPlayer *pPlayer = (CBaseTFPlayer*)UTIL_PlayerByIndex( i );
if ( pPlayer )
{
// Am I an intermission?
if ( HasSpawnFlags( SF_ACT_INTERMISSION ) )
{
StartIntermission( pPlayer );
}
else
{
StartActOverlayTime( pPlayer );
}
}
}
// Think again soon, to remove player locks
if ( !HasSpawnFlags(SF_ACT_INTERMISSION) )
{
SetNextThink( gpGlobals->curtime + MIN_ACT_OVERLAY_TIME );
SetThink( ActThinkEndActOverlayTime );
}
}