本文整理汇总了C++中FIND_ENTITY_BY_TARGETNAME函数的典型用法代码示例。如果您正苦于以下问题:C++ FIND_ENTITY_BY_TARGETNAME函数的具体用法?C++ FIND_ENTITY_BY_TARGETNAME怎么用?C++ FIND_ENTITY_BY_TARGETNAME使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FIND_ENTITY_BY_TARGETNAME函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Link
void CPathTrack :: Link( void )
{
edict_t *pentTarget;
if ( !FStringNull(pev->target) )
{
pentTarget = FIND_ENTITY_BY_TARGETNAME( NULL, STRING(pev->target) );
if ( !FNullEnt(pentTarget) )
{
m_pnext = CPathTrack::Instance( pentTarget );
if ( m_pnext ) // If no next pointer, this is the end of a path
{
m_pnext->SetPrevious( this );
}
}
else
ALERT( at_console, "Dead end link %s\n", STRING(pev->target) );
}
// Find "alternate" path
if ( m_altName )
{
pentTarget = FIND_ENTITY_BY_TARGETNAME( NULL, STRING(m_altName) );
if ( !FNullEnt(pentTarget) )
{
m_paltpath = CPathTrack::Instance( pentTarget );
if ( m_paltpath ) // If no next pointer, this is the end of a path
{
m_paltpath->SetPrevious( this );
}
}
}
}
开发者ID:6779660,项目名称:halflife,代码行数:35,代码来源:pathcorner.cpp
示例2: StudioFrameAdvance
void COsprey::FlyThink( void )
{
StudioFrameAdvance( );
pev->nextthink = gpGlobals->time + 0.1;
if ( m_pGoalEnt == NULL && !FStringNull(pev->target) )// this monster has a target
{
m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME ( NULL, STRING( pev->target ) ) );
UpdateGoal( );
}
if (gpGlobals->time > m_startTime + m_dTime)
{
if (m_pGoalEnt->pev->speed == 0)
{
SetThink( DeployThink );
}
do {
m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME ( NULL, STRING( m_pGoalEnt->pev->target ) ) );
} while (m_pGoalEnt->pev->speed < 400 && !HasDead());
UpdateGoal( );
}
Flight( );
ShowDamage( );
}
开发者ID:XashDev,项目名称:XashXT,代码行数:26,代码来源:osprey.cpp
示例3: FIND_ENTITY_BY_TARGETNAME
/* <8dd79> ../cstrike/dlls/func_tank.cpp:821 */
CLaser *CFuncTankLaser::GetLaser(void)
{
if (m_pLaser != NULL)
{
return m_pLaser;
}
edict_t *pentLaser;
pentLaser = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->message));
while (!FNullEnt(pentLaser))
{
// Found the landmark
if (FClassnameIs(pentLaser, "env_laser"))
{
m_pLaser = (CLaser *)CBaseEntity::Instance(pentLaser);
break;
}
else
pentLaser = FIND_ENTITY_BY_TARGETNAME(pentLaser, STRING(pev->message));
}
return m_pLaser;
}
开发者ID:Adidasman1,项目名称:ReGameDLL_CS,代码行数:26,代码来源:func_tank.cpp
示例4: ChangeSub
void CTriggerSubModel :: ChangeSub ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
if ( FStringNull ( pev->target ) )
return;
edict_t *pentTarget = FIND_ENTITY_BY_TARGETNAME ( NULL, STRING(pev->target) );
if ( FNullEnt(pentTarget) )
{
ALERT ( at_console, "CTriggerSubModel : pas d'entite s appelant %s\n", STRING(pev->target) );
return;
}
CBaseEntity *pTarget = Instance( pentTarget );
if ( pTarget->MyMonsterPointer() == NULL )
{
ALERT ( at_console, "CTriggerSubModel : %s n est pas un monstre\n", STRING(pev->target) );
return;
}
CBaseMonster *pMonster = (CBaseMonster*)pTarget;
pMonster->SetBodygroup( m_iBodygroup, m_iSubmodel);
}
开发者ID:jlecorre,项目名称:hlinvasion,代码行数:25,代码来源:t_sub.cpp
示例5: FireTargets
void FireTargets( const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
edict_t *pentTarget = NULL;
if ( !targetName )
return;
ALERT( at_aiconsole, "Firing: (%s)\n", targetName );
for (;;)
{
pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, targetName);
if (FNullEnt(pentTarget))
break;
CBaseEntity *pTarget = CBaseEntity::Instance( pentTarget );
if ( pTarget && !(pTarget->pev->flags & FL_KILLME) ) // Don't use dying ents
{
ALERT( at_aiconsole, "Found: %s, firing (%s)\n", STRING(pTarget->pev->classname), targetName );
if ( strcmp( STRING( pCaller->pev->classname ), "func_breakable" ) == 0 ) {
CBaseEntity *breakable = CBaseEntity::Instance( pCaller->pev );
if ( breakable->killedOrCausedByPlayer ) {
pTarget->auxOwner = breakable->auxOwner;
pTarget->killedOrCausedByPlayer = true;
}
}
pTarget->Use( pActivator, pCaller, useType, value );
}
}
}
开发者ID:suXinjke,项目名称:HalfPayne,代码行数:29,代码来源:subs.cpp
示例6: FireTargets
void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
edict_t *pentTarget = NULL;
if (!targetName)
return;
ALERT(at_aiconsole, "Firing: (%s)\n", targetName);
while (1)
{
pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, targetName);
if (FNullEnt(pentTarget))
break;
CBaseEntity *pTarget = CBaseEntity::Instance(pentTarget);
if (pTarget && !(pTarget->pev->flags & FL_KILLME))
{
ALERT(at_aiconsole, "Found: %s, firing (%s)\n", STRING(pTarget->pev->classname), targetName);
pTarget->Use(pActivator, pCaller, useType, value);
}
}
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:25,代码来源:subs.cpp
示例7: FIND_ENTITY_BY_TARGETNAME
// find a viable entity
int CCineMonster::FindEntity(void)
{
edict_t *pentTarget;
pentTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(m_iszEntity));
m_hTargetEnt = NULL;
CBaseMonster *pTarget = NULL;
while(!FNullEnt(pentTarget))
{
if(FBitSet(VARS(pentTarget)->flags, FL_MONSTER))
{
pTarget = GetMonsterPointer(pentTarget);
if(pTarget && pTarget->CanPlaySequence(FCanOverrideState(), SS_INTERRUPT_BY_NAME))
{
m_hTargetEnt = pTarget;
return TRUE;
}
ALERT(at_console, "Found %s, but can't play!\n", STRING(m_iszEntity));
}
pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, STRING(m_iszEntity));
pTarget = NULL;
}
if(!pTarget)
{
CBaseEntity *pEntity = NULL;
while((pEntity = UTIL_FindEntityInSphere(pEntity, pev->origin, m_flRadius)) != NULL)
{
if(FClassnameIs(pEntity->pev, STRING(m_iszEntity)))
{
if(FBitSet(pEntity->pev->flags, FL_MONSTER))
{
pTarget = pEntity->MyMonsterPointer();
if(pTarget && pTarget->CanPlaySequence(FCanOverrideState(), SS_INTERRUPT_IDLE))
{
m_hTargetEnt = pTarget;
return TRUE;
}
}
}
}
}
pTarget = NULL;
m_hTargetEnt = NULL;
return FALSE;
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:48,代码来源:Scripted.cpp
示例8: GetClassPtr
void CBaseDelay::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value)
{
if (FStringNull(pev->target) && !m_iszKillTarget)
return;
if (m_flDelay != 0)
{
CBaseDelay *pTemp = GetClassPtr((CBaseDelay *)NULL);
if (pTemp->pev->classname)
RemoveEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME);
pTemp->pev->classname = MAKE_STRING("DelayedUse");
AddEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME);
pTemp->pev->nextthink = gpGlobals->time + m_flDelay;
pTemp->SetThink(&CBaseDelay::DelayThink);
pTemp->pev->button = (int)useType;
pTemp->m_iszKillTarget = m_iszKillTarget;
pTemp->m_flDelay = 0;
pTemp->pev->target = pev->target;
if (pActivator && pActivator->IsPlayer())
pTemp->pev->owner = pActivator->edict();
else
pTemp->pev->owner = NULL;
return;
}
if (m_iszKillTarget)
{
ALERT(at_aiconsole, "KillTarget: %s\n", STRING(m_iszKillTarget));
edict_t *pentKillTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(m_iszKillTarget));
while (!FNullEnt(pentKillTarget))
{
UTIL_Remove(CBaseEntity::Instance(pentKillTarget));
ALERT(at_aiconsole, "killing %s\n", STRING(pentKillTarget->v.classname));
pentKillTarget = FIND_ENTITY_BY_TARGETNAME(pentKillTarget, STRING(m_iszKillTarget));
}
}
if (!FStringNull(pev->target))
FireTargets(STRING(pev->target), pActivator, this, useType, value);
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:46,代码来源:subs.cpp
示例9: ALERT
// find all the cinematic entities with my targetname and stop them from playing
void CCineMonster::CancelScript(void)
{
ALERT(at_aiconsole, "Cancelling script: %s\n", STRING(m_iszPlay));
if(!pev->targetname)
{
ScriptEntityCancel(edict());
return;
}
edict_t *pentCineTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->targetname));
while(!FNullEnt(pentCineTarget))
{
ScriptEntityCancel(pentCineTarget);
pentCineTarget = FIND_ENTITY_BY_TARGETNAME(pentCineTarget, STRING(pev->targetname));
}
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:19,代码来源:Scripted.cpp
示例10: FIND_ENTITY_BY_TARGETNAME
CBaseEntity *CBaseEntity::GetNextTarget(void)
{
if(FStringNull(pev->target))
return NULL;
edict_t *pTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target));
if(FNullEnt(pTarget))
return NULL;
return Instance(pTarget);
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:10,代码来源:cbase.cpp
示例11: assert
// Button has returned to start state. Quiesce it.
void CBaseButton::ButtonBackHome()
{
assert(m_toggle_state == TS_GOING_DOWN);
m_toggle_state = TS_AT_BOTTOM;
if (pev->spawnflags & SF_BUTTON_TOGGLE
#ifdef REGAMEDLL_FIXES
&& m_hActivator
#endif
)
{
//EMIT_SOUND(ENT(pev), CHAN_VOICE, (char *)STRING(pev->noise), 1, ATTN_NORM);
SUB_UseTargets(m_hActivator, USE_TOGGLE, 0);
}
if (!FStringNull(pev->target))
{
edict_t *pentTarget = NULL;
while ((pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, STRING(pev->target))) != NULL)
{
if (FNullEnt(pentTarget))
break;
if (!FClassnameIs(pentTarget, "multisource"))
continue;
CBaseEntity *pTarget = CBaseEntity::Instance(pentTarget);
if (pTarget != NULL)
{
pTarget->Use(m_hActivator, this, USE_TOGGLE, 0);
}
}
}
// Re-instate touch method, movement cycle is complete.
// this button only works if USED, not touched!
if (!(pev->spawnflags & SF_BUTTON_TOUCH_ONLY))
{
// All buttons are now use only
SetTouch(NULL);
}
else
SetTouch(&CBaseButton::ButtonTouch);
// reset think for a sparking button
if (pev->spawnflags & SF_BUTTON_SPARK_IF_OFF)
{
SetThink(&CBaseButton::ButtonSpark);
// no hurry.
pev->nextthink = gpGlobals->time + 0.5f;
}
}
开发者ID:Chuvi-w,项目名称:ReGameDLL_CS,代码行数:56,代码来源:buttons.cpp
示例12: FIND_ENTITY_BY_TARGETNAME
void CFuncTankControls::Think(void)
{
edict_t *pTarget = NULL;
do pTarget = FIND_ENTITY_BY_TARGETNAME(pTarget, STRING(pev->target));
while (!FNullEnt(pTarget) && strncmp(STRING(pTarget->v.classname), "func_tank", 9));
if (FNullEnt(pTarget))
{
ALERT(at_console, "No tank %s\n", STRING(pev->target));
return;
}
m_pTank = (CFuncTank*)Instance(pTarget);
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:15,代码来源:func_tank.cpp
示例13: Touch
void CPathCorner :: Touch( CBaseEntity *pOther )
{
entvars_t* pevToucher = pOther->pev;
if ( FBitSet ( pevToucher->flags, FL_MONSTER ) )
{// monsters don't navigate path corners based on touch anymore
return;
}
// If OTHER isn't explicitly looking for this path_corner, bail out
if ( pOther->m_pGoalEnt != this )
{
return;
}
// If OTHER has an enemy, this touch is incidental, ignore
if ( !FNullEnt(pevToucher->enemy) )
{
return; // fighting, not following a path
}
// UNDONE: support non-zero flWait
/*
if (m_flWait != 0)
ALERT(at_warning, "Non-zero path-cornder waits NYI");
*/
// Find the next "stop" on the path, make it the goal of the "toucher".
if (FStringNull(pev->target))
{
ALERT(at_warning, "PathCornerTouch: no next stop specified");
}
pOther->m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME ( NULL, STRING(pev->target) ) );
// If "next spot" was not found (does not exist - level design error)
if ( !pOther->m_pGoalEnt )
{
ALERT(at_console, "PathCornerTouch--%s couldn't find next stop in path: %s", STRING(pev->classname), STRING(pev->target));
return;
}
// Turn towards the next stop in the path.
pevToucher->ideal_yaw = UTIL_VecToYaw ( pOther->m_pGoalEnt->pev->origin - pevToucher->origin );
}
开发者ID:6779660,项目名称:halflife,代码行数:45,代码来源:pathcorner.cpp
示例14: FIND_ENTITY_BY_TARGETNAME
void CMomentaryRotButton::UpdateTarget( float value )
{
if (!FStringNull(pev->target))
{
edict_t* pentTarget = NULL;
for (;;)
{
pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, STRING(pev->target));
if (FNullEnt(pentTarget))
break;
CBaseEntity *pEntity = CBaseEntity::Instance(pentTarget);
if ( pEntity )
{
pEntity->Use( this, this, USE_SET, value );
}
}
}
}
开发者ID:Fograin,项目名称:hl-subsmod-ex,代码行数:18,代码来源:buttons.cpp
示例15: UTIL_IsMasterTriggered
bool UTIL_IsMasterTriggered( string_t sMaster, const CBaseEntity* const pActivator )
{
if (sMaster)
{
edict_t *pentTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(sMaster));
if ( !FNullEnt(pentTarget) )
{
CBaseEntity *pMaster = CBaseEntity::Instance(pentTarget);
if ( pMaster && (pMaster->ObjectCaps() & FCAP_MASTER) )
return pMaster->IsTriggered( pActivator );
}
ALERT(at_console, "Master was null or not a master!\n");
}
// if this isn't a master entity, just say yes.
return true;
}
开发者ID:CryoKeen,项目名称:HLEnhanced,代码行数:19,代码来源:util.cpp
示例16: find_ent_by_tname
static cell AMX_NATIVE_CALL find_ent_by_tname(AMX *amx, cell *params) {
int iStart = params[1];
int iLength;
char *szValue = MF_GetAmxString(amx, params[2], 0, &iLength);
edict_t *pStart;
if (iStart == -1) {
pStart = NULL;
} else {
if (!is_ent_valid(iStart))
pStart = NULL;
else
pStart = INDEXENT2(iStart);
}
int iReturnEnt = ENTINDEX(FIND_ENTITY_BY_TARGETNAME(pStart, szValue));
return iReturnEnt;
}
开发者ID:Chuvi-w,项目名称:amxmodx,代码行数:20,代码来源:entity.cpp
示例17: ASSERT
void CBaseButton::ButtonBackHome(void)
{
ASSERT(m_toggle_state == TS_GOING_DOWN);
m_toggle_state = TS_AT_BOTTOM;
if (FBitSet(pev->spawnflags, SF_BUTTON_TOGGLE))
SUB_UseTargets(m_hActivator, USE_TOGGLE, 0);
if (!FStringNull(pev->target))
{
edict_t *pentTarget = NULL;
while (1)
{
pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, STRING(pev->target));
if (FNullEnt(pentTarget))
break;
if (!FClassnameIs(pentTarget, "multisource"))
continue;
CBaseEntity *pTarget = CBaseEntity::Instance(pentTarget);
if (pTarget)
pTarget->Use(m_hActivator, this, USE_TOGGLE, 0);
}
}
if (!FBitSet(pev->spawnflags, SF_BUTTON_TOUCH_ONLY))
SetTouch(NULL);
else
SetTouch(&CBaseButton::ButtonTouch);
if (FBitSet(pev->spawnflags, SF_BUTTON_SPARK_IF_OFF))
{
SetThink(&CBaseButton::ButtonSpark);
pev->nextthink = gpGlobals->time + 0.5;
}
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:40,代码来源:buttons.cpp
示例18: Blocked
//modif de Julien
void CMomentaryDoor :: Blocked( CBaseEntity *pOther )
{
if ( FBitSet ( pev->spawnflags, SF_MOMENT_DOOR_BLOCK ) )
{
edict_t *pentCherche = NULL;
for ( int i = 0 ; i < 5 ; i++ )
{
pentCherche = FIND_ENTITY_BY_TARGETNAME ( pentCherche, STRING( pev->target ));
if ( FClassnameIs( pentCherche, "momentary_rot_button" ) ) //"momentary_door" ) )
{
CBaseEntity* pDoor = CBaseEntity :: Instance ( pentCherche );
pDoor->pev->target = NULL;
}
}
ClearBits ( pev->spawnflags, SF_MOMENT_DOOR_BLOCK );
FireTargets ( STRING(pev->netname), this, this, USE_ON, 0 );
}
}
开发者ID:jlecorre,项目名称:hlinvasion,代码行数:23,代码来源:doors.cpp
示例19: STRING
void CFuncVehicle::Find()
{
m_ppath = CPathTrack::Instance(FIND_ENTITY_BY_TARGETNAME(nullptr, STRING(pev->target)));
if (!m_ppath)
return;
entvars_t *pevTarget = m_ppath->pev;
if (!FClassnameIs(pevTarget, "path_track"))
{
ALERT(at_error, "func_track_train must be on a path of path_track\n");
m_ppath = nullptr;
return;
}
Vector nextPos = pevTarget->origin;
nextPos.z += m_height;
Vector look = nextPos;
look.z -= m_height;
m_ppath->LookAhead(&look, m_length, 0);
look.z += m_height;
pev->angles = UTIL_VecToAngles(look - nextPos);
pev->angles.y += 180;
if (pev->spawnflags & SF_TRACKTRAIN_NOPITCH)
{
pev->angles.x = 0;
}
UTIL_SetOrigin(pev, nextPos);
NextThink(pev->ltime + 0.1, FALSE);
SetThink(&CFuncVehicle::Next);
pev->speed = m_startSpeed;
UpdateSound();
}
开发者ID:s1lentq,项目名称:ReGameDLL_CS,代码行数:38,代码来源:vehicle.cpp
示例20: while
void CRenderFxManager::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
if( !FStringNull( pev->target ) )
{
edict_t* pentTarget = NULL;
while( 1 )
{
pentTarget = FIND_ENTITY_BY_TARGETNAME( pentTarget, STRING( pev->target ) );
if( FNullEnt( pentTarget ) )
break;
entvars_t *pevTarget = VARS( pentTarget );
if( !FBitSet( pev->spawnflags, SF_RENDER_MASKFX ) )
pevTarget->renderfx = pev->renderfx;
if( !FBitSet( pev->spawnflags, SF_RENDER_MASKAMT ) )
pevTarget->renderamt = pev->renderamt;
if( !FBitSet( pev->spawnflags, SF_RENDER_MASKMODE ) )
pevTarget->rendermode = pev->rendermode;
if( !FBitSet( pev->spawnflags, SF_RENDER_MASKCOLOR ) )
pevTarget->rendercolor = pev->rendercolor;
}
}
}
开发者ID:CryoKeen,项目名称:HLEnhanced,代码行数:23,代码来源:CRenderFxManager.cpp
注:本文中的FIND_ENTITY_BY_TARGETNAME函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论