本文整理汇总了C++中CBitVec::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ CBitVec::Clear方法的具体用法?C++ CBitVec::Clear怎么用?C++ CBitVec::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBitVec
的用法示例。
在下文中一共展示了CBitVec::Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BacktrackEntity
//.........这里部分代码省略.........
maxs = record->m_vecMaxs;
}
// See if this is still a valid position for us to teleport to
if ( sv_unlag_fixstuck.GetBool() )
{
// Try to move to the wanted position from our current position.
trace_t tr;
UTIL_TraceEntity( pEntity, org, org, MASK_NPCSOLID, &tr );
if ( tr.startsolid || tr.allsolid )
{
if ( sv_unlag_debug.GetBool() )
DevMsg( "WARNING: BackupEntity trying to back entity into a bad position - %s\n", pEntity->GetClassname() );
CBasePlayer *pHitPlayer = dynamic_cast<CBasePlayer *>( tr.m_pEnt );
// don't lag compensate the current player
if ( pHitPlayer && ( pHitPlayer != m_pCurrentPlayer ) )
{
// If we haven't backtracked this player, do it now
// this deliberately ignores WantsLagCompensationOnEntity.
if ( !m_RestorePlayer.Get( pHitPlayer->entindex() - 1 ) )
{
// prevent recursion - save a copy of m_RestorePlayer,
// pretend that this player is off-limits
int pl_index = pEntity->entindex() - 1;
// Temp turn this flag on
m_RestorePlayer.Set( pl_index );
BacktrackPlayer( pHitPlayer, flTargetTime );
// Remove the temp flag
m_RestorePlayer.Clear( pl_index );
}
}
else
{
CAI_BaseNPC *pHitEntity = dynamic_cast<CAI_BaseNPC *>( tr.m_pEnt );
if ( pHitEntity )
{
CAI_BaseNPC *pNPC = NULL;
CAI_BaseNPC **ppAIs = g_AI_Manager.AccessAIs();
int nAIs = g_AI_Manager.NumAIs();
for ( int i = 0; i < nAIs; i++ ) // we'll have to find this entity's index though :(
{
pNPC = ppAIs[i];
if ( pNPC == pHitEntity )
break;
}
// If we haven't backtracked this player, do it now
// this deliberately ignores WantsLagCompensationOnEntity.
if ( pNPC && !m_RestoreEntity.Get( pNPC->GetAIIndex() ) )
{
// prevent recursion - save a copy of m_RestoreEntity,
// pretend that this player is off-limits
// Temp turn this flag on
m_RestoreEntity.Set( pNPC->GetAIIndex() );
BacktrackEntity( pHitEntity, flTargetTime );
// Remove the temp flag
m_RestoreEntity.Clear( pNPC->GetAIIndex() );
}
}