本文整理汇总了C++中game_import_t::unlinkentity方法的典型用法代码示例。如果您正苦于以下问题:C++ game_import_t::unlinkentity方法的具体用法?C++ game_import_t::unlinkentity怎么用?C++ game_import_t::unlinkentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_import_t
的用法示例。
在下文中一共展示了game_import_t::unlinkentity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: G_RunFrame
void G_RunFrame( int levelTime ) {
int i;
gentity_t *ent;
int msec;
int ents_inuse=0; // someone's gonna be pissed I put this here...
#if AI_TIMERS
AITime = 0;
navTime = 0;
#endif// AI_TIMERS
level.framenum++;
level.previousTime = level.time;
level.time = levelTime;
msec = level.time - level.previousTime;
NAV_CheckCalcPaths();
//ResetTeamCounters();
AI_UpdateGroups();
if ( d_altRoutes->integer )
{
navigator.CheckAllFailedEdges();
}
navigator.ClearCheckedNodes();
//remember last waypoint, clear current one
// for ( i = 0, ent = &g_entities[0]; i < globals.num_entities ; i++, ent++)
for ( i = 0; i < globals.num_entities ; i++)
{
// if ( !ent->inuse )
// continue;
if(!PInUse(i))
continue;
ent = &g_entities[i];
if ( ent->waypoint != WAYPOINT_NONE
&& ent->noWaypointTime < level.time )
{
ent->lastWaypoint = ent->waypoint;
ent->waypoint = WAYPOINT_NONE;
}
if ( d_altRoutes->integer )
{
navigator.CheckFailedNodes( ent );
}
}
//Look to clear out old events
ClearPlayerAlertEvents();
//Run the frame for all entities
// for ( i = 0, ent = &g_entities[0]; i < globals.num_entities ; i++, ent++)
for ( i = 0; i < globals.num_entities ; i++)
{
// if ( !ent->inuse )
// continue;
if(!PInUse(i))
continue;
ents_inuse++;
ent = &g_entities[i];
// clear events that are too old
if ( level.time - ent->eventTime > EVENT_VALID_MSEC ) {
if ( ent->s.event ) {
ent->s.event = 0; // &= EV_EVENT_BITS;
if ( ent->client ) {
ent->client->ps.externalEvent = 0;
}
}
if ( ent->freeAfterEvent ) {
// tempEntities or dropped items completely go away after their event
G_FreeEntity( ent );
continue;
} else if ( ent->unlinkAfterEvent ) {
// items that will respawn will hide themselves after their pickup event
ent->unlinkAfterEvent = qfalse;
gi.unlinkentity( ent );
}
}
// temporary entities don't think
if ( ent->freeAfterEvent )
continue;
G_CheckTasksCompleted(ent);
G_Roff( ent );
if( !ent->client )
{
if ( !(ent->svFlags & SVF_SELF_ANIMATING) )
{//FIXME: make sure this is done only for models with frames?
//Or just flag as animating?
if ( ent->s.eFlags & EF_ANIM_ONCE )
{
ent->s.frame++;
//.........这里部分代码省略.........