本文整理汇总了C++中CGlobalEntityList::NextEnt方法的典型用法代码示例。如果您正苦于以下问题:C++ CGlobalEntityList::NextEnt方法的具体用法?C++ CGlobalEntityList::NextEnt怎么用?C++ CGlobalEntityList::NextEnt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGlobalEntityList
的用法示例。
在下文中一共展示了CGlobalEntityList::NextEnt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FrameUpdatePostEntityThink
void FrameUpdatePostEntityThink()
{
g_TouchManager.FrameUpdatePostEntityThink();
if ( m_bRespawnAllEntities )
{
m_bRespawnAllEntities = false;
// Don't change globalstate owing to deletion here
GlobalEntity_EnableStateUpdates( false );
// Remove all entities
int nPlayerIndex = -1;
CBaseEntity *pEnt = gEntList.FirstEnt();
while ( pEnt )
{
CBaseEntity *pNextEnt = gEntList.NextEnt( pEnt );
if ( pEnt->IsPlayer() )
{
nPlayerIndex = pEnt->entindex();
}
if ( !pEnt->IsEFlagSet( EFL_KEEP_ON_RECREATE_ENTITIES ) )
{
UTIL_Remove( pEnt );
}
pEnt = pNextEnt;
}
gEntList.CleanupDeleteList();
GlobalEntity_EnableStateUpdates( true );
// Allows us to immediately re-use the edict indices we just freed to avoid edict overflow
engine->AllowImmediateEdictReuse();
// Reset node counter used during load
CNodeEnt::m_nNodeCount = 0;
CRespawnEntitiesFilter filter;
MapEntity_ParseAllEntities( engine->GetMapEntitiesString(), &filter, true );
// Allocate a CBasePlayer for pev, and call spawn
if ( nPlayerIndex >= 0 )
{
edict_t *pEdict = engine->PEntityOfEntIndex( nPlayerIndex );
ClientPutInServer( pEdict, "unnamed" );
ClientActive( pEdict, false );
CBasePlayer *pPlayer = ( CBasePlayer * )CBaseEntity::Instance( pEdict );
SceneManager_ClientActive( pPlayer );
}
}
}
示例2: ForceRepopulateList
void ForceRepopulateList()
{
Clear();
CBaseEntity *pEnt = gEntList.FirstEnt();
while( pEnt )
{
if( ShouldAddEntity(pEnt) )
AddEntity(pEnt);
pEnt = gEntList.NextEnt( pEnt );
}
}