本文整理汇总了C++中FStringNull函数的典型用法代码示例。如果您正苦于以下问题:C++ FStringNull函数的具体用法?C++ FStringNull怎么用?C++ FStringNull使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FStringNull函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PlayLockSounds
/* <6a3b8> ../cstrike/dlls/doors.cpp:508 */
void CBaseDoor::DoorTouch(CBaseEntity *pOther)
{
entvars_t *pevToucher = pOther->pev;
// Ignore touches by dead players
if (pevToucher->deadflag != DEAD_NO)
return;
// If door has master, and it's not ready to trigger,
// play 'locked' sound
if (!FStringNull(m_sMaster) && !UTIL_IsMasterTriggered(m_sMaster, pOther))
{
PlayLockSounds(pev, &m_ls, TRUE, FALSE);
}
// If door is somebody's target, then touching does nothing.
// You have to activate the owner (e.g. button).
if (!FStringNull(pev->targetname))
{
// play locked sound
PlayLockSounds(pev, &m_ls, TRUE, FALSE);
return;
}
// remember who activated the door
m_hActivator = pOther;
if (DoorActivate())
{
// Temporarily disable the touch function, until movement is finished.
SetTouch(NULL);
}
}
开发者ID:Arkshine,项目名称:ReGameDLL_CS,代码行数:34,代码来源:doors.cpp
示例2: MAKE_STRING
void CPython::Holster( int skiplocal /* = 0 */ )
{
if (m_fInZoom == TRUE)
{
m_pPlayer->b_EstaEnZoom = FALSE;
#ifndef CLIENT_DLL
if (!FStringNull (v_model) )
m_pPlayer->pev->viewmodel = v_model;
else
m_pPlayer->pev->viewmodel = MAKE_STRING("models/weapons/357/v_357.mdl");
#else
if (!FStringNull (v_model) )
m_pPlayer->pev->viewmodel = v_model;
else
LoadVModel ( "models/weapons/357/v_357.mdl", m_pPlayer );
#endif
m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 0; // 0 means reset to default fov
m_fInZoom = FALSE;
}
m_fInReload = FALSE;// cancel any reload in progress.
// if ( m_fInZoom )
// {
// SecondaryAttack();
// }
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0;
m_flTimeWeaponIdle = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
SendWeaponAnim( PYTHON_IDLE1 );//PYTHON_HOLSTER
}
开发者ID:JoelTroch,项目名称:am_src_30jan2011,代码行数:32,代码来源:wep_357.cpp
示例3: Spawn
void CCineMonster::Spawn(void)
{
// pev->solid = SOLID_TRIGGER;
// UTIL_SetSize(pev, Vector(-8, -8, -8), Vector(8, 8, 8));
pev->solid = SOLID_NOT;
// REMOVE: The old side-effect
#if 0
if ( m_iszIdle )
m_fMoveTo = 4;
#endif
// if no targetname, start now
if(FStringNull(pev->targetname) || !FStringNull(m_iszIdle))
{
SetThink(&CCineMonster::CineThink);
pev->nextthink = gpGlobals->time + 1.0;
// Wait to be used?
if(pev->targetname)
m_startTime = gpGlobals->time + 1E6;
}
if(pev->spawnflags & SF_SCRIPT_NOINTERRUPT)
m_interruptable = FALSE;
else
m_interruptable = TRUE;
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:26,代码来源:Scripted.cpp
示例4: ChainTouch
void CBaseDoor::DoorTouch( CBaseEntity *pOther )
{
if( !FStringNull( m_iChainTarget ))
ChainTouch( pOther );
m_bDoorTouched = true;
// ignore touches by anything but players and pushables
if( !pOther->IsPlayer() && !pOther->IsPushable()) return;
m_hActivator = pOther; // remember who activated the door
// If door has master, and it's not ready to trigger,
// play 'locked' sound
if( IsLockedByMaster( ))
PlayLockSounds( pev, &m_ls, TRUE, FALSE );
// If door is somebody's target, then touching does nothing.
// You have to activate the owner (e.g. button).
// g-cont. but allow touch for chain doors
if( !FStringNull( pev->targetname ) && FStringNull( m_iChainTarget ))
{
// play locked sound
PlayLockSounds( pev, &m_ls, TRUE, FALSE );
return;
}
if( DoorActivate( ))
{
// temporarily disable the touch function, until movement is finished.
SetTouch( NULL );
}
}
开发者ID:XashDev,项目名称:XashXT,代码行数:33,代码来源:doors.cpp
示例5: SUB_UseTargets
void CBaseDelay :: SUB_UseTargets( CBaseEntity *pActivator, USE_TYPE useType, float value )
{
//
// exit immediatly if we don't have a target or kill target
//
if (FStringNull(pev->target) && !m_iszKillTarget)
return;
//
// check for a delay
//
if (m_flDelay != 0)
{
// create a temp object to fire at a later time
CBaseDelay *pTemp = GetClassPtr( (CBaseDelay *)NULL);
pTemp->pev->classname = MAKE_STRING("DelayedUse");
pTemp->SetNextThink( m_flDelay );
pTemp->SetThink(&CBaseDelay:: DelayThink );
// Save the useType
pTemp->pev->button = (int)useType;
pTemp->m_iszKillTarget = m_iszKillTarget;
pTemp->m_flDelay = 0; // prevent "recursion"
pTemp->pev->target = pev->target;
//LRC - Valve had a hacked thing here to avoid breaking
// save/restore. In Spirit that's not a problem.
// I've moved m_hActivator into this class, for the "elegant" fix.
pTemp->m_hActivator = pActivator;
return;
}
//
// kill the killtargets
//
if ( m_iszKillTarget )
{
edict_t *pentKillTarget = NULL;
ALERT( at_aiconsole, "KillTarget: %s\n", STRING(m_iszKillTarget) );
//LRC- now just USE_KILLs its killtarget, for consistency.
FireTargets( STRING(m_iszKillTarget), pActivator, this, USE_KILL, 0);
}
//
// fire targets
//
if (!FStringNull(pev->target))
{
FireTargets( STRING(pev->target), pActivator, this, useType, value );
}
}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:56,代码来源:subs.cpp
示例6: UTIL_TraceLine
//=========================================================
// TryMakeMonster- check that it's ok to drop a monster.
//=========================================================
void CMonsterMaker::TryMakeMonster( void )
{
if ( m_iMaxLiveChildren > 0 && m_cLiveChildren >= m_iMaxLiveChildren )
{// not allowed to make a new one yet. Too many live ones out right now.
return;
}
if ( !m_flGround )
{
// set altitude. Now that I'm activated, any breakables, etc should be out from under me.
TraceResult tr;
UTIL_TraceLine ( pev->origin, pev->origin - Vector ( 0, 0, 2048 ), ignore_monsters, ENT(pev), &tr );
m_flGround = tr.vecEndPos.z;
}
Vector mins = pev->origin - Vector( 34, 34, 0 );
Vector maxs = pev->origin + Vector( 34, 34, 0 );
maxs.z = pev->origin.z;
mins.z = m_flGround;
CBaseEntity *pList[2];
int count = UTIL_EntitiesInBox( pList, 2, mins, maxs, FL_CLIENT|FL_MONSTER );
if ( count )
{
// don't build a stack of monsters!
return;
}
if (m_fSpawnDelay)
{
// If I have a target, fire. (no locus)
if ( !FStringNull ( pev->target ) )
{
// delay already overloaded for this entity, so can't call SUB_UseTargets()
FireTargets( STRING(pev->target), this, this, USE_TOGGLE, 0 );
}
// ALERT(at_console,"Making Monster in %f seconds\n",m_fSpawnDelay);
SetThink(&CMonsterMaker:: MakeMonsterThink );
SetNextThink( m_fSpawnDelay );
}
else
{
// ALERT(at_console,"No delay. Making monster.\n",m_fSpawnDelay);
CBaseMonster* pMonst = MakeMonster();
// If I have a target, fire! (the new monster is the locus)
if ( !FStringNull ( pev->target ) )
{
FireTargets( STRING(pev->target), pMonst, this, USE_TOGGLE, 0 );
}
}
}
开发者ID:RichardRohac,项目名称:hl-amnesia-src,代码行数:57,代码来源:monstermaker.cpp
示例7: SetThink
void CLightning::Spawn( void )
{
if ( FStringNull( m_iszSpriteName ) )
{
SetThink( SUB_Remove );
return;
}
pev->solid = SOLID_NOT; // Remove model & collisions
Precache( );
pev->dmgtime = gpGlobals->time;
if ( ServerSide() )
{
SetThink( NULL );
if ( pev->dmg > 0 )
{
SetThink( DamageThink );
pev->nextthink = gpGlobals->time + 0.1;
}
if ( pev->targetname )
{
if ( !(pev->spawnflags & SF_BEAM_STARTON) )
{
pev->effects = EF_NODRAW;
m_active = 0;
pev->nextthink = 0;
}
else
m_active = 1;
SetUse( ToggleUse );
}
}
else
{
m_active = 0;
if ( !FStringNull(pev->targetname) )
{
SetUse( StrikeUse );
}
if ( FStringNull(pev->targetname) || FBitSet(pev->spawnflags, SF_BEAM_STARTON) )
{
SetThink( StrikeThink );
pev->nextthink = gpGlobals->time + 1.0;
}
}
}
开发者ID:NoFreeWill,项目名称:MultiplayerSource,代码行数:48,代码来源:effects.cpp
示例8: while
void CMultiSource::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
int i = 0;
// Find the entity in our list
while (i < m_iTotal)
{
if (m_rgEntities[i++] == pCaller)
break;
}
// if we didn't find it, report error and leave
if (i > m_iTotal)
{
ALERT(at_console, "MultiSrc:Used by non member %s.\n", STRING(pCaller->pev->classname));
return;
}
// CONSIDER: a Use input to the multisource always toggles.
// Could check useType for ON/OFF/TOGGLE
m_rgTriggered[i - 1] ^= 1;
if (IsTriggered(pActivator))
{
ALERT(at_aiconsole, "Multisource %s enabled (%d inputs)\n", STRING(pev->targetname), m_iTotal);
USE_TYPE useType = USE_TOGGLE;
if (!FStringNull(m_globalstate))
{
useType = USE_ON;
}
SUB_UseTargets(NULL, useType, 0);
}
}
开发者ID:Chuvi-w,项目名称:ReGameDLL_CS,代码行数:35,代码来源:buttons.cpp
示例9: Precache
void CAmbientGeneric :: Precache( void )
{
char* szSoundFile = (char*) STRING(pev->message);
if ( !FStringNull( pev->message ) && strlen( szSoundFile ) > 1 )
{
if (*szSoundFile != '!')
PRECACHE_SOUND(szSoundFile);
}
// init all dynamic modulation parms
InitModulationParms();
if ( !FBitSet (pev->spawnflags, AMBIENT_SOUND_START_SILENT ) )
{
// start the sound ASAP
if (m_fLooping)
m_fActive = TRUE;
}
if ( m_fActive )
{
UTIL_EmitAmbientSound ( ENT(pev), pev->origin, szSoundFile,
(m_dpv.vol * 0.01), m_flAttenuation, SND_SPAWNING, m_dpv.pitch);
pev->nextthink = gpGlobals->time + 0.1;
}
}
开发者ID:6779660,项目名称:halflife,代码行数:26,代码来源:sound.cpp
示例10: 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
示例11: Spawn
void CLaser::Spawn(void)
{
if(FStringNull(pev->model))
{
SetThink(&CLaser::SUB_Remove);
return;
}
pev->solid = SOLID_NOT; // Remove model & collisions
Precache();
SetThink(&CLaser::StrikeThink);
pev->flags |= FL_CUSTOMENTITY;
PointsInit(pev->origin, pev->origin);
if(!m_pSprite && m_iszSpriteName)
m_pSprite = CSprite::SpriteCreate(STRING(m_iszSpriteName), pev->origin, TRUE);
else
m_pSprite = NULL;
if(m_pSprite)
m_pSprite->SetTransparency(kRenderGlow, pev->rendercolor.x, pev->rendercolor.y, pev->rendercolor.z, pev->renderamt, pev->renderfx);
if(pev->targetname && !(pev->spawnflags & SF_BEAM_STARTON))
TurnOff();
else
TurnOn();
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:28,代码来源:Laser.cpp
示例12: PlayLockSounds
//
// Doors not tied to anything (e.g. button, another door) can be touched, to make them activate.
//
void CBaseDoor::DoorTouch( CBaseEntity *pOther )
{
entvars_t* pevToucher = pOther->pev;
// Ignore touches by anything but players
if (!FClassnameIs(pevToucher, "player"))
return;
// If door has master, and it's not ready to trigger,
// play 'locked' sound
if (m_sMaster && !UTIL_IsMasterTriggered(m_sMaster, pOther))
PlayLockSounds(pev, &m_ls, TRUE, FALSE);
// If door is somebody's target, then touching does nothing.
// You have to activate the owner (e.g. button).
//LRC- allow flags to override this
if (!FStringNull(pev->targetname) && !FBitSet(pev->spawnflags,SF_DOOR_FORCETOUCHABLE))
{
// play locked sound
PlayLockSounds(pev, &m_ls, TRUE, FALSE);
return;
}
m_hActivator = pOther;// remember who activated the door
if (DoorActivate( ))
SetTouch( NULL ); // Temporarily disable the touch function, until movement is finished.
}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:32,代码来源:func_doors.cpp
示例13: GiveAmmo
//=========================================================
// CWeaponBox - GiveAmmo
//=========================================================
int CWeaponBox::GiveAmmo( int iCount, char *szName, int iMax, int *pIndex/* = NULL*/ )
{
int i;
for (i = 1; i < MAX_AMMO_SLOTS && !FStringNull( m_rgiszAmmo[i] ); i++)
{
if (stricmp( szName, STRING( m_rgiszAmmo[i])) == 0)
{
if (pIndex)
*pIndex = i;
int iAdd = min( iCount, iMax - m_rgAmmo[i]);
if (iCount == 0 || iAdd > 0)
{
m_rgAmmo[i] += iAdd;
return i;
}
return -1;
}
}
if (i < MAX_AMMO_SLOTS)
{
if (pIndex)
*pIndex = i;
m_rgiszAmmo[i] = MAKE_STRING( szName );
m_rgAmmo[i] = iCount;
return i;
}
ALERT( at_console, "out of named ammo slots\n");
return i;
}
开发者ID:vermagav,项目名称:mechmod,代码行数:37,代码来源:weapons.cpp
示例14: 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
示例15: GetDoorMovementGroup
// lists all doors in the same movement group as this one
int CBaseDoor :: GetDoorMovementGroup( CBaseDoor *pDoorList[], int listMax )
{
CBaseEntity *pTarget = NULL;
int count = 0;
// block all door pieces with the same targetname here.
if( !FStringNull( pev->targetname ))
{
while(( pTarget = UTIL_FindEntityByTargetname( pTarget, STRING( pev->targetname ))) != NULL )
{
if( pTarget != this && FClassnameIs( pTarget, GetClassname() ))
{
CBaseDoor *pDoor = (CBaseDoor *)pTarget;
if( pDoor && count < listMax )
{
pDoorList[count] = pDoor;
count++;
}
}
}
}
return count;
}
开发者ID:XashDev,项目名称:XashXT,代码行数:26,代码来源:doors.cpp
示例16: MAKE_STRING
void CAK74::Spawn( )
{
pev->classname = MAKE_STRING("weapon_AK47"); // hack to allow for old names
Precache( );
// SET_MODEL(ENT(pev), "models/weapons/ak-47/w_AK47.mdl");
if (!FStringNull (v_model) )
SET_MODEL( ENT(pev), STRING(w_model) );
else
SET_MODEL(ENT(pev), "models/weapons/ak-47/w_AK47.mdl");
m_iId = WEAPON_AK74;
if (pev->armorvalue)
{
if ((pev->armorvalue > AK74_DEFAULT_AMMO) && (pev->armorvalue < 0))
pev->armorvalue = AK74_DEFAULT_AMMO;
m_iDefaultAmmo = pev->armorvalue;
}
else
m_iDefaultAmmo = AK74_DEFAULT_AMMO;
m_fDefaultAnim = 0;//not really necessary, I guess
FallInit();// get ready to fall down.
}
开发者ID:JoelTroch,项目名称:am_src_30jan2011,代码行数:27,代码来源:wep_ak47.cpp
示例17: GenericCyclerSpawn
void CInfoCommentary :: GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
{
if (!szModel || !*szModel)
{
ALERT(at_error, "cycler at %.0f %.0f %0.f missing modelname", pev->origin.x, pev->origin.y, pev->origin.z );
REMOVE_ENTITY(ENT(pev));
return;
}
//ignored on subsequent calls
char* szSoundFile = (char*) STRING(pev->message);
if ( !FStringNull( pev->message ) && strlen( szSoundFile ) > 1 )
{
PRECACHE_SOUND(szSoundFile);
}
//ignored on subsequent calls
pev->classname = MAKE_STRING("info_commentary");
PRECACHE_MODEL( szModel );
SET_MODEL(ENT(pev), szModel);
CCycler::Spawn( );
UTIL_SetSize(pev, vecMin, vecMax);
}
开发者ID:JoelTroch,项目名称:am_src_rebirth,代码行数:26,代码来源:h_cycler.cpp
示例18: STOP_SOUND
/* <694a5> ../cstrike/dlls/doors.cpp:791 */
void CBaseDoor::DoorHitBottom(void)
{
if (!(pev->spawnflags & SF_DOOR_SILENT))
{
STOP_SOUND(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseMoving));
EMIT_SOUND(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseArrived), VOL_NORM, ATTN_NORM);
}
assert(m_toggle_state == TS_GOING_DOWN);
m_toggle_state = TS_AT_BOTTOM;
// Re-instate touch method, cycle is complete
if (pev->spawnflags & SF_DOOR_USE_ONLY)
{
// use only door
SetTouch(NULL);
}
else
{
// touchable door
SetTouch(&CBaseDoor::DoorTouch);
}
// this isn't finished
SUB_UseTargets(m_hActivator, USE_TOGGLE, 0);
// Fire the close target (if startopen is set, then "top" is closed) - netname is the close target
if (!FStringNull(pev->netname) && !(pev->spawnflags & SF_DOOR_START_OPEN))
{
FireTargets(STRING(pev->netname), m_hActivator, this, USE_TOGGLE, 0);
}
}
开发者ID:Arkshine,项目名称:ReGameDLL_CS,代码行数:33,代码来源:doors.cpp
示例19: ARRAYSIZE
int CBaseEntity::Restore( CRestore &restore )
{
int status;
status = restore.ReadEntVars( "ENTVARS", pev );
if ( status )
status = restore.ReadFields( "BASE", this, m_SaveData, ARRAYSIZE(m_SaveData) );
//LLAPb begin
//Precache script
//if ( status )
//status = restore.ReadScriptVars( "SAMOGON" ... );
//Find function "LOAD", pass args to it, but don't call it!!!
//LLAPb end
if ( pev->modelindex != 0 && !FStringNull(pev->model) )
{
Vector mins, maxs;
mins = pev->mins; // Set model is about to destroy these
maxs = pev->maxs;
PRECACHE_MODEL( (char *)STRING(pev->model) );
SET_MODEL(ENT(pev), STRING(pev->model));
UTIL_SetSize(pev, mins, maxs); // Reset them
}
return status;
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:32,代码来源:cbase.cpp
示例20: Use
void CRadiomsg :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
CBaseEntity *pPlayer = UTIL_FindEntityByClassname ( NULL,"player" );
char txt [256];
sprintf ( txt, STRING(m_iszText));
int len = strlen ( txt );
MESSAGE_BEGIN( MSG_ONE, gmsgRadioMsg, NULL, pPlayer->pev );
WRITE_COORD ( gpGlobals->time );
WRITE_LONG ( m_iHead );
WRITE_LONG ( len );
for ( int i=0; i<180; i++ ) {
WRITE_BYTE ( txt[i] ); }
MESSAGE_END();
if ( FStringNull ( m_iszSentence ) )
return;
// EMIT_SOUND_SUIT(pPlayer->edict(), STRING(m_iszSentence) );
EMIT_SOUND_DYN(pPlayer->edict(), CHAN_STATIC, STRING(m_iszSentence), 1.0, ATTN_NORM, 0, 100);
}
开发者ID:jlecorre,项目名称:hlinvasion,代码行数:32,代码来源:radiomsg.cpp
注:本文中的FStringNull函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论