Fix usage of SetThink/Touch/Use/Blocked/MoveDone macros

This commit is contained in:
Alibek Omarov 2023-09-06 05:09:49 +03:00
parent c7e0cc3906
commit 584d1a597e
26 changed files with 238 additions and 238 deletions

View file

@ -419,7 +419,7 @@ void CFuncRotating :: Spawn( )
UTIL_SetOrigin(pev, pev->origin); UTIL_SetOrigin(pev, pev->origin);
SET_MODEL( ENT(pev), STRING(pev->model) ); SET_MODEL( ENT(pev), STRING(pev->model) );
SetUse( RotatingUse ); SetUse( &CFuncRotating::RotatingUse );
// did level designer forget to assign speed? // did level designer forget to assign speed?
if (pev->speed <= 0) if (pev->speed <= 0)
pev->speed = 0; pev->speed = 0;
@ -431,13 +431,13 @@ void CFuncRotating :: Spawn( )
// instant-use brush? // instant-use brush?
if ( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT) ) if ( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT) )
{ {
SetThink( SUB_CallUseToggle ); SetThink( &CBaseEntity::SUB_CallUseToggle );
pev->nextthink = pev->ltime + 1.5; // leave a magic delay for client to start up pev->nextthink = pev->ltime + 1.5; // leave a magic delay for client to start up
} }
// can this brush inflict pain? // can this brush inflict pain?
if ( FBitSet (pev->spawnflags, SF_BRUSH_HURT) ) if ( FBitSet (pev->spawnflags, SF_BRUSH_HURT) )
{ {
SetTouch( HurtTouch ); SetTouch( &CFuncRotating::HurtTouch );
} }
Precache( ); Precache( );
@ -504,7 +504,7 @@ void CFuncRotating :: Precache( void )
// if fan was spinning, and we went through transition or save/restore, // if fan was spinning, and we went through transition or save/restore,
// make sure we restart the sound. 1.5 sec delay is magic number. KDB // make sure we restart the sound. 1.5 sec delay is magic number. KDB
SetThink ( SpinUp ); SetThink ( &CFuncRotating::SpinUp );
pev->nextthink = pev->ltime + 1.5; pev->nextthink = pev->ltime + 1.5;
} }
} }
@ -600,7 +600,7 @@ void CFuncRotating :: SpinUp( void )
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning), EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning),
m_flVolume, m_flAttenuation, SND_CHANGE_PITCH | SND_CHANGE_VOL, FANPITCHMAX); m_flVolume, m_flAttenuation, SND_CHANGE_PITCH | SND_CHANGE_VOL, FANPITCHMAX);
SetThink( Rotate ); SetThink( &CFuncRotating::Rotate );
Rotate(); Rotate();
} }
else else
@ -641,7 +641,7 @@ void CFuncRotating :: SpinDown( void )
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning /* Stop */), EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning /* Stop */),
0, 0, SND_STOP, m_pitch); 0, 0, SND_STOP, m_pitch);
SetThink( Rotate ); SetThink( &CFuncRotating::Rotate );
Rotate(); Rotate();
} }
else else
@ -666,7 +666,7 @@ void CFuncRotating :: RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller
// fan is spinning, so stop it. // fan is spinning, so stop it.
if ( pev->avelocity != g_vecZero ) if ( pev->avelocity != g_vecZero )
{ {
SetThink ( SpinDown ); SetThink ( &CFuncRotating::SpinDown );
//EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStop), //EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStop),
// m_flVolume, m_flAttenuation, 0, m_pitch); // m_flVolume, m_flAttenuation, 0, m_pitch);
@ -674,7 +674,7 @@ void CFuncRotating :: RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller
} }
else// fan is not moving, so start it else// fan is not moving, so start it
{ {
SetThink ( SpinUp ); SetThink ( &CFuncRotating::SpinUp );
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning), EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning),
0.01, m_flAttenuation, 0, FANPITCHMIN); 0.01, m_flAttenuation, 0, FANPITCHMIN);
@ -686,7 +686,7 @@ void CFuncRotating :: RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller
if ( pev->avelocity != g_vecZero ) if ( pev->avelocity != g_vecZero )
{ {
// play stopping sound here // play stopping sound here
SetThink ( SpinDown ); SetThink ( &CFuncRotating::SpinDown );
// EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStop), // EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStop),
// m_flVolume, m_flAttenuation, 0, m_pitch); // m_flVolume, m_flAttenuation, 0, m_pitch);
@ -700,7 +700,7 @@ void CFuncRotating :: RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller
m_flVolume, m_flAttenuation, 0, FANPITCHMAX); m_flVolume, m_flAttenuation, 0, FANPITCHMAX);
pev->avelocity = pev->movedir * pev->speed; pev->avelocity = pev->movedir * pev->speed;
SetThink( Rotate ); SetThink( &CFuncRotating::Rotate );
Rotate(); Rotate();
} }
} }
@ -812,15 +812,15 @@ void CPendulum :: Spawn( void )
if ( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT) ) if ( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT) )
{ {
SetThink( SUB_CallUseToggle ); SetThink( &CBaseEntity::SUB_CallUseToggle );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
pev->speed = 0; pev->speed = 0;
SetUse( PendulumUse ); SetUse( &CPendulum::PendulumUse );
if ( FBitSet( pev->spawnflags, SF_PENDULUM_SWING ) ) if ( FBitSet( pev->spawnflags, SF_PENDULUM_SWING ) )
{ {
SetTouch ( RopeTouch ); SetTouch ( &CPendulum::RopeTouch );
} }
} }
@ -837,7 +837,7 @@ void CPendulum :: PendulumUse( CBaseEntity *pActivator, CBaseEntity *pCaller, US
pev->avelocity = m_maxSpeed * pev->movedir; pev->avelocity = m_maxSpeed * pev->movedir;
pev->nextthink = pev->ltime + (delta / m_maxSpeed); pev->nextthink = pev->ltime + (delta / m_maxSpeed);
SetThink( Stop ); SetThink( &CPendulum::Stop );
} }
else else
{ {
@ -850,7 +850,7 @@ void CPendulum :: PendulumUse( CBaseEntity *pActivator, CBaseEntity *pCaller, US
{ {
pev->nextthink = pev->ltime + 0.1; // Start the pendulum moving pev->nextthink = pev->ltime + 0.1; // Start the pendulum moving
m_time = gpGlobals->time; // Save time to calculate dt m_time = gpGlobals->time; // Save time to calculate dt
SetThink( Swing ); SetThink( &CPendulum::Swing );
m_dampSpeed = m_maxSpeed; m_dampSpeed = m_maxSpeed;
} }
} }

View file

@ -173,7 +173,7 @@ void CMultiSource::Spawn()
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
pev->spawnflags |= SF_MULTI_INIT; // Until it's initialized pev->spawnflags |= SF_MULTI_INIT; // Until it's initialized
SetThink(Register); SetThink(&CMultiSource::Register);
} }
void CMultiSource::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void CMultiSource::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
@ -240,7 +240,7 @@ void CMultiSource::Register(void)
m_iTotal = 0; m_iTotal = 0;
memset( m_rgEntities, 0, MS_MAX_TARGETS * sizeof(EHANDLE) ); memset( m_rgEntities, 0, MS_MAX_TARGETS * sizeof(EHANDLE) );
SetThink(SUB_DoNothing); SetThink(&CBaseEntity::SUB_DoNothing);
// search for all entities which target this multisource (pev->targetname) // search for all entities which target this multisource (pev->targetname)
@ -455,7 +455,7 @@ void CBaseButton::Spawn( )
if ( FBitSet ( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) )// this button should spark in OFF state if ( FBitSet ( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) )// this button should spark in OFF state
{ {
SetThink ( ButtonSpark ); SetThink ( &CBaseButton::ButtonSpark );
pev->nextthink = gpGlobals->time + 0.5;// no hurry, make sure everything else spawns pev->nextthink = gpGlobals->time + 0.5;// no hurry, make sure everything else spawns
} }
@ -495,12 +495,12 @@ void CBaseButton::Spawn( )
if ( FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) ) // touchable button if ( FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) ) // touchable button
{ {
SetTouch( ButtonTouch ); SetTouch( &CBaseButton::ButtonTouch );
} }
else else
{ {
SetTouch ( NULL ); SetTouch ( NULL );
SetUse ( ButtonUse ); SetUse ( &CBaseButton::ButtonUse );
} }
} }
@ -567,7 +567,7 @@ void DoSpark(entvars_t *pev, const Vector &location )
void CBaseButton::ButtonSpark ( void ) void CBaseButton::ButtonSpark ( void )
{ {
SetThink ( ButtonSpark ); SetThink ( &CBaseButton::ButtonSpark );
pev->nextthink = gpGlobals->time + ( 0.1 + RANDOM_FLOAT ( 0, 1.5 ) );// spark again at random interval pev->nextthink = gpGlobals->time + ( 0.1 + RANDOM_FLOAT ( 0, 1.5 ) );// spark again at random interval
DoSpark( pev, pev->mins ); DoSpark( pev, pev->mins );
@ -680,7 +680,7 @@ void CBaseButton::ButtonActivate( )
ASSERT(m_toggle_state == TS_AT_BOTTOM); ASSERT(m_toggle_state == TS_AT_BOTTOM);
m_toggle_state = TS_GOING_UP; m_toggle_state = TS_GOING_UP;
SetMoveDone( TriggerAndWait ); SetMoveDone( &CBaseButton::TriggerAndWait );
if (!m_fRotating) if (!m_fRotating)
LinearMove( m_vecPosition2, pev->speed); LinearMove( m_vecPosition2, pev->speed);
else else
@ -709,12 +709,12 @@ void CBaseButton::TriggerAndWait( void )
SetTouch ( NULL ); SetTouch ( NULL );
} }
else else
SetTouch( ButtonTouch ); SetTouch( &CBaseButton::ButtonTouch );
} }
else else
{ {
pev->nextthink = pev->ltime + m_flWait; pev->nextthink = pev->ltime + m_flWait;
SetThink( ButtonReturn ); SetThink( &CBaseButton::ButtonReturn );
} }
pev->frame = 1; // use alternate textures pev->frame = 1; // use alternate textures
@ -732,7 +732,7 @@ void CBaseButton::ButtonReturn( void )
ASSERT(m_toggle_state == TS_AT_TOP); ASSERT(m_toggle_state == TS_AT_TOP);
m_toggle_state = TS_GOING_DOWN; m_toggle_state = TS_GOING_DOWN;
SetMoveDone( ButtonBackHome ); SetMoveDone( &CBaseButton::ButtonBackHome );
if (!m_fRotating) if (!m_fRotating)
LinearMove( m_vecPosition1, pev->speed); LinearMove( m_vecPosition1, pev->speed);
else else
@ -784,12 +784,12 @@ void CBaseButton::ButtonBackHome( void )
SetTouch ( NULL ); SetTouch ( NULL );
} }
else else
SetTouch( ButtonTouch ); SetTouch( &CBaseButton::ButtonTouch );
// reset think for a sparking button // reset think for a sparking button
if ( FBitSet ( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) ) if ( FBitSet ( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) )
{ {
SetThink ( ButtonSpark ); SetThink ( &CBaseButton::ButtonSpark );
pev->nextthink = gpGlobals->time + 0.5;// no hurry. pev->nextthink = gpGlobals->time + 0.5;// no hurry.
} }
} }
@ -857,10 +857,10 @@ void CRotButton::Spawn( void )
if ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) ) if ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) )
{ {
SetTouch ( NULL ); SetTouch ( NULL );
SetUse ( ButtonUse ); SetUse ( &CBaseButton::ButtonUse );
} }
else // touchable button else // touchable button
SetTouch( ButtonTouch ); SetTouch( &CBaseButton::ButtonTouch );
//SetTouch( ButtonTouch ); //SetTouch( ButtonTouch );
} }
@ -1049,7 +1049,7 @@ void CMomentaryRotButton::UpdateSelf( float value )
pev->nextthink += 0.1; pev->nextthink += 0.1;
pev->avelocity = (m_direction * pev->speed) * pev->movedir; pev->avelocity = (m_direction * pev->speed) * pev->movedir;
SetThink( Off ); SetThink( &CMomentaryRotButton::Off );
} }
void CMomentaryRotButton::UpdateTarget( float value ) void CMomentaryRotButton::UpdateTarget( float value )
@ -1077,7 +1077,7 @@ void CMomentaryRotButton::Off( void )
m_lastUsed = 0; m_lastUsed = 0;
if ( FBitSet( pev->spawnflags, SF_PENDULUM_AUTO_RETURN ) && m_returnSpeed > 0 ) if ( FBitSet( pev->spawnflags, SF_PENDULUM_AUTO_RETURN ) && m_returnSpeed > 0 )
{ {
SetThink( Return ); SetThink( &CMomentaryRotButton::Return );
pev->nextthink = pev->ltime + 0.1; pev->nextthink = pev->ltime + 0.1;
m_direction = -1; m_direction = -1;
} }
@ -1154,14 +1154,14 @@ void CEnvSpark::Spawn(void)
{ {
if (FBitSet(pev->spawnflags, 64)) // Start on if (FBitSet(pev->spawnflags, 64)) // Start on
{ {
SetThink(SparkThink); // start sparking SetThink(&CEnvSpark::SparkThink); // start sparking
SetUse(SparkStop); // set up +USE to stop sparking SetUse(&CEnvSpark::SparkStop); // set up +USE to stop sparking
} }
else else
SetUse(SparkStart); SetUse(&CEnvSpark::SparkStart);
} }
else else
SetThink(SparkThink); SetThink(&CEnvSpark::SparkThink);
pev->nextthink = gpGlobals->time + ( 0.1 + RANDOM_FLOAT ( 0, 1.5 ) ); pev->nextthink = gpGlobals->time + ( 0.1 + RANDOM_FLOAT ( 0, 1.5 ) );
@ -1208,14 +1208,14 @@ void EXPORT CEnvSpark::SparkThink(void)
void EXPORT CEnvSpark::SparkStart(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void EXPORT CEnvSpark::SparkStart(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
SetUse(SparkStop); SetUse(&CEnvSpark::SparkStop);
SetThink(SparkThink); SetThink(&CEnvSpark::SparkThink);
pev->nextthink = gpGlobals->time + (0.1 + RANDOM_FLOAT ( 0, m_flDelay)); pev->nextthink = gpGlobals->time + (0.1 + RANDOM_FLOAT ( 0, m_flDelay));
} }
void EXPORT CEnvSpark::SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void EXPORT CEnvSpark::SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
SetUse(SparkStart); SetUse(&CEnvSpark::SparkStart);
SetThink(NULL); SetThink(NULL);
} }

View file

@ -118,7 +118,7 @@ void CGib :: SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs
pGib->pev->movetype = MOVETYPE_TOSS; pGib->pev->movetype = MOVETYPE_TOSS;
pGib->pev->solid = SOLID_BBOX; pGib->pev->solid = SOLID_BBOX;
UTIL_SetSize ( pGib->pev, Vector ( 0, 0 ,0 ), Vector ( 0, 0, 0 ) ); UTIL_SetSize ( pGib->pev, Vector ( 0, 0 ,0 ), Vector ( 0, 0, 0 ) );
pGib->SetTouch ( StickyGibTouch ); pGib->SetTouch ( &CGib::StickyGibTouch );
pGib->SetThink (NULL); pGib->SetThink (NULL);
} }
pGib->LimitVelocity(); pGib->LimitVelocity();
@ -334,7 +334,7 @@ void CBaseMonster :: GibMonster( void )
if ( gibbed ) if ( gibbed )
{ {
// don't remove players! // don't remove players!
SetThink ( SUB_Remove ); SetThink ( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
else else
@ -657,7 +657,7 @@ void CBaseEntity :: SUB_StartFadeOut ( void )
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetThink ( SUB_FadeOut ); SetThink ( &CBaseEntity::SUB_FadeOut );
} }
void CBaseEntity :: SUB_FadeOut ( void ) void CBaseEntity :: SUB_FadeOut ( void )
@ -671,7 +671,7 @@ void CBaseEntity :: SUB_FadeOut ( void )
{ {
pev->renderamt = 0; pev->renderamt = 0;
pev->nextthink = gpGlobals->time + 0.2; pev->nextthink = gpGlobals->time + 0.2;
SetThink ( SUB_Remove ); SetThink ( &CBaseEntity::SUB_Remove );
} }
} }
@ -691,7 +691,7 @@ void CGib :: WaitTillLand ( void )
if ( pev->velocity == g_vecZero ) if ( pev->velocity == g_vecZero )
{ {
SetThink (SUB_StartFadeOut); SetThink (&CBaseEntity::SUB_StartFadeOut);
pev->nextthink = gpGlobals->time + m_lifeTime; pev->nextthink = gpGlobals->time + m_lifeTime;
// If you bleed, you stink! // If you bleed, you stink!
@ -759,7 +759,7 @@ void CGib :: StickyGibTouch ( CBaseEntity *pOther )
Vector vecSpot; Vector vecSpot;
TraceResult tr; TraceResult tr;
SetThink ( SUB_Remove ); SetThink ( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time + 10; pev->nextthink = gpGlobals->time + 10;
if ( !FClassnameIs( pOther->pev, "worldspawn" ) ) if ( !FClassnameIs( pOther->pev, "worldspawn" ) )
@ -800,8 +800,8 @@ void CGib :: Spawn( const char *szGibModel )
pev->nextthink = gpGlobals->time + 4; pev->nextthink = gpGlobals->time + 4;
m_lifeTime = 25; m_lifeTime = 25;
SetThink ( WaitTillLand ); SetThink ( &CGib::WaitTillLand );
SetTouch ( BounceGibTouch ); SetTouch ( &CGib::BounceGibTouch );
m_material = matNone; m_material = matNone;
m_cBloodDecals = 5;// how many blood decals this gib can place (1 per bounce until none remain). m_cBloodDecals = 5;// how many blood decals this gib can place (1 per bounce until none remain).

View file

@ -320,7 +320,7 @@ void CBaseDoor::Spawn( )
SetTouch ( NULL ); SetTouch ( NULL );
} }
else // touchable button else // touchable button
SetTouch( DoorTouch ); SetTouch( &CBaseDoor::DoorTouch );
} }
@ -575,7 +575,7 @@ void CBaseDoor::DoorGoUp( void )
m_toggle_state = TS_GOING_UP; m_toggle_state = TS_GOING_UP;
SetMoveDone( DoorHitTop ); SetMoveDone( &CBaseDoor::DoorHitTop );
if ( FClassnameIs(pev, "func_door_rotating")) // !!! BUGBUG Triggered doors don't work with this yet if ( FClassnameIs(pev, "func_door_rotating")) // !!! BUGBUG Triggered doors don't work with this yet
{ {
float sign = 1.0; float sign = 1.0;
@ -624,13 +624,13 @@ void CBaseDoor::DoorHitTop( void )
{ {
// Re-instate touch method, movement is complete // Re-instate touch method, movement is complete
if ( !FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) ) if ( !FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) )
SetTouch( DoorTouch ); SetTouch( &CBaseDoor::DoorTouch );
} }
else else
{ {
// In flWait seconds, DoorGoDown will fire, unless wait is -1, then door stays open // In flWait seconds, DoorGoDown will fire, unless wait is -1, then door stays open
pev->nextthink = pev->ltime + m_flWait; pev->nextthink = pev->ltime + m_flWait;
SetThink( DoorGoDown ); SetThink( &CBaseDoor::DoorGoDown );
if ( m_flWait == -1 ) if ( m_flWait == -1 )
{ {
@ -659,7 +659,7 @@ void CBaseDoor::DoorGoDown( void )
#endif // DOOR_ASSERT #endif // DOOR_ASSERT
m_toggle_state = TS_GOING_DOWN; m_toggle_state = TS_GOING_DOWN;
SetMoveDone( DoorHitBottom ); SetMoveDone( &CBaseDoor::DoorHitBottom );
if ( FClassnameIs(pev, "func_door_rotating"))//rotating door if ( FClassnameIs(pev, "func_door_rotating"))//rotating door
AngularMove( m_vecAngle1, pev->speed); AngularMove( m_vecAngle1, pev->speed);
else else
@ -686,7 +686,7 @@ void CBaseDoor::DoorHitBottom( void )
SetTouch ( NULL ); SetTouch ( NULL );
} }
else // touchable door else // touchable door
SetTouch( DoorTouch ); SetTouch( &CBaseDoor::DoorTouch );
SUB_UseTargets( m_hActivator, USE_TOGGLE, 0 ); // this isn't finished SUB_UseTargets( m_hActivator, USE_TOGGLE, 0 ); // this isn't finished
@ -860,7 +860,7 @@ void CRotDoor::Spawn( void )
SetTouch ( NULL ); SetTouch ( NULL );
} }
else // touchable button else // touchable button
SetTouch( DoorTouch ); SetTouch( &CBaseDoor::DoorTouch );
} }

View file

@ -87,7 +87,7 @@ void CBubbling::Spawn( void )
if ( !(pev->spawnflags & SF_BUBBLES_STARTOFF) ) if ( !(pev->spawnflags & SF_BUBBLES_STARTOFF) )
{ {
SetThink( FizzThink ); SetThink( &CBubbling::FizzThink );
pev->nextthink = gpGlobals->time + 2.0; pev->nextthink = gpGlobals->time + 2.0;
m_state = 1; m_state = 1;
} }
@ -108,7 +108,7 @@ void CBubbling::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
if ( m_state ) if ( m_state )
{ {
SetThink( FizzThink ); SetThink( &CBubbling::FizzThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
else else
@ -459,7 +459,7 @@ void CLightning::Spawn( void )
{ {
if ( FStringNull( m_iszSpriteName ) ) if ( FStringNull( m_iszSpriteName ) )
{ {
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
return; return;
} }
pev->solid = SOLID_NOT; // Remove model & collisions pev->solid = SOLID_NOT; // Remove model & collisions
@ -472,7 +472,7 @@ void CLightning::Spawn( void )
SetThink( NULL ); SetThink( NULL );
if ( pev->dmg > 0 ) if ( pev->dmg > 0 )
{ {
SetThink( DamageThink ); SetThink( &CLightning::DamageThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
if ( pev->targetname ) if ( pev->targetname )
@ -486,7 +486,7 @@ void CLightning::Spawn( void )
else else
m_active = 1; m_active = 1;
SetUse( ToggleUse ); SetUse( &CLightning::ToggleUse );
} }
} }
else else
@ -494,11 +494,11 @@ void CLightning::Spawn( void )
m_active = 0; m_active = 0;
if ( !FStringNull(pev->targetname) ) if ( !FStringNull(pev->targetname) )
{ {
SetUse( StrikeUse ); SetUse( &CLightning::StrikeUse );
} }
if ( FStringNull(pev->targetname) || FBitSet(pev->spawnflags, SF_BEAM_STARTON) ) if ( FStringNull(pev->targetname) || FBitSet(pev->spawnflags, SF_BEAM_STARTON) )
{ {
SetThink( StrikeThink ); SetThink( &CLightning::StrikeThink );
pev->nextthink = gpGlobals->time + 1.0; pev->nextthink = gpGlobals->time + 1.0;
} }
} }
@ -616,7 +616,7 @@ void CLightning::StrikeUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
} }
else else
{ {
SetThink( StrikeThink ); SetThink( &CLightning::StrikeThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -961,13 +961,13 @@ void CLaser::Spawn( void )
{ {
if ( FStringNull( pev->model ) ) if ( FStringNull( pev->model ) )
{ {
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
return; return;
} }
pev->solid = SOLID_NOT; // Remove model & collisions pev->solid = SOLID_NOT; // Remove model & collisions
Precache( ); Precache( );
SetThink( StrikeThink ); SetThink( &CLaser::StrikeThink );
pev->flags |= FL_CUSTOMENTITY; pev->flags |= FL_CUSTOMENTITY;
PointsInit( pev->origin, pev->origin ); PointsInit( pev->origin, pev->origin );
@ -1264,7 +1264,7 @@ void CSprite::Expand( float scaleSpeed, float fadeSpeed )
{ {
pev->speed = scaleSpeed; pev->speed = scaleSpeed;
pev->health = fadeSpeed; pev->health = fadeSpeed;
SetThink( ExpandThink ); SetThink( &CSprite::ExpandThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
m_lastTime = gpGlobals->time; m_lastTime = gpGlobals->time;
@ -1319,7 +1319,7 @@ void CSprite::TurnOn( void )
pev->effects = 0; pev->effects = 0;
if ( (pev->framerate && m_maxFrame > 1.0) || (pev->spawnflags & SF_SPRITE_ONCE) ) if ( (pev->framerate && m_maxFrame > 1.0) || (pev->spawnflags & SF_SPRITE_ONCE) )
{ {
SetThink( AnimateThink ); SetThink( &CSprite::AnimateThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
m_lastTime = gpGlobals->time; m_lastTime = gpGlobals->time;
} }
@ -1426,7 +1426,7 @@ void CGibShooter::KeyValue( KeyValueData *pkvd )
void CGibShooter::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void CGibShooter::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
SetThink( ShootThink ); SetThink( &CGibShooter::ShootThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -1516,7 +1516,7 @@ void CGibShooter :: ShootThink ( void )
} }
else else
{ {
SetThink ( SUB_Remove ); SetThink ( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
} }
@ -1708,7 +1708,7 @@ void CTestEffect::TestThink( void )
void CTestEffect::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void CTestEffect::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
SetThink( TestThink ); SetThink( &CTestEffect::TestThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
m_flStartTime = gpGlobals->time; m_flStartTime = gpGlobals->time;
} }
@ -2129,7 +2129,7 @@ void CEnvFunnel::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us
MESSAGE_END(); MESSAGE_END();
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -2184,7 +2184,7 @@ void CEnvBeverage::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
pev->frags = 1; pev->frags = 1;
pev->health--; pev->health--;
//SetThink (SUB_Remove); //SetThink (&CBaseEntity::SUB_Remove);
//pev->nextthink = gpGlobals->time; //pev->nextthink = gpGlobals->time;
} }
@ -2228,7 +2228,7 @@ void CItemSoda::Spawn( void )
SET_MODEL ( ENT(pev), "models/can.mdl" ); SET_MODEL ( ENT(pev), "models/can.mdl" );
UTIL_SetSize ( pev, Vector ( 0, 0, 0 ), Vector ( 0, 0, 0 ) ); UTIL_SetSize ( pev, Vector ( 0, 0, 0 ), Vector ( 0, 0, 0 ) );
SetThink (CanThink); SetThink (&CItemSoda::CanThink);
pev->nextthink = gpGlobals->time + 0.5; pev->nextthink = gpGlobals->time + 0.5;
} }
@ -2239,7 +2239,7 @@ void CItemSoda::CanThink ( void )
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
UTIL_SetSize ( pev, Vector ( -8, -8, 0 ), Vector ( 8, 8, 8 ) ); UTIL_SetSize ( pev, Vector ( -8, -8, 0 ), Vector ( 8, 8, 8 ) );
SetThink ( NULL ); SetThink ( NULL );
SetTouch ( CanTouch ); SetTouch ( &CItemSoda::CanTouch );
} }
void CItemSoda::CanTouch ( CBaseEntity *pOther ) void CItemSoda::CanTouch ( CBaseEntity *pOther )
@ -2263,6 +2263,6 @@ void CItemSoda::CanTouch ( CBaseEntity *pOther )
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
pev->effects = EF_NODRAW; pev->effects = EF_NODRAW;
SetTouch ( NULL ); SetTouch ( NULL );
SetThink ( SUB_Remove ); SetThink ( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }

View file

@ -79,7 +79,7 @@ public:
inline void AnimateAndDie( float framerate ) inline void AnimateAndDie( float framerate )
{ {
SetThink(AnimateUntilDead); SetThink(&CSprite::AnimateUntilDead);
pev->framerate = framerate; pev->framerate = framerate;
pev->dmgtime = gpGlobals->time + (m_maxFrame / framerate); pev->dmgtime = gpGlobals->time + (m_maxFrame / framerate);
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
@ -168,7 +168,7 @@ public:
static CBeam *BeamCreate( const char *pSpriteName, int width ); static CBeam *BeamCreate( const char *pSpriteName, int width );
inline void LiveForTime( float time ) { SetThink(SUB_Remove); pev->nextthink = gpGlobals->time + time; } inline void LiveForTime( float time ) { SetThink(&CBaseEntity::SUB_Remove); pev->nextthink = gpGlobals->time + time; }
inline void BeamDamageInstant( TraceResult *ptr, float damage ) inline void BeamDamageInstant( TraceResult *ptr, float damage )
{ {
pev->dmg = damage; pev->dmg = damage;

View file

@ -217,7 +217,7 @@ void CEnvExplosion::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
RadiusDamage ( pev, pev, m_iMagnitude, CLASS_NONE, DMG_BLAST ); RadiusDamage ( pev, pev, m_iMagnitude, CLASS_NONE, DMG_BLAST );
} }
SetThink( Smoke ); SetThink( &CEnvExplosion::Smoke );
pev->nextthink = gpGlobals->time + 0.3; pev->nextthink = gpGlobals->time + 0.3;
// draw sparks // draw sparks

View file

@ -165,7 +165,7 @@ void CBreakable::Spawn( void )
SET_MODEL(ENT(pev), STRING(pev->model) );//set size and link into world. SET_MODEL(ENT(pev), STRING(pev->model) );//set size and link into world.
SetTouch( BreakTouch ); SetTouch( &CBreakable::BreakTouch );
if ( FBitSet( pev->spawnflags, SF_BREAK_TRIGGER_ONLY ) ) // Only break on trigger if ( FBitSet( pev->spawnflags, SF_BREAK_TRIGGER_ONLY ) ) // Only break on trigger
SetTouch( NULL ); SetTouch( NULL );
@ -461,7 +461,7 @@ void CBreakable::BreakTouch( CBaseEntity *pOther )
// play creaking sound here. // play creaking sound here.
DamageSound(); DamageSound();
SetThink ( Die ); SetThink ( &CBreakable::Die );
SetTouch( NULL ); SetTouch( NULL );
if ( m_flDelay == 0 ) if ( m_flDelay == 0 )
@ -747,7 +747,7 @@ void CBreakable::Die( void )
// Fire targets on break // Fire targets on break
SUB_UseTargets( NULL, USE_TOGGLE, 0 ); SUB_UseTargets( NULL, USE_TOGGLE, 0 );
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
pev->nextthink = pev->ltime + 0.1; pev->nextthink = pev->ltime + 0.1;
if ( m_iszSpawnObject ) if ( m_iszSpawnObject )
CBaseEntity::Create( (char *)STRING(m_iszSpawnObject), VecBModelOrigin(pev), pev->angles, edict() ); CBaseEntity::Create( (char *)STRING(m_iszSpawnObject), VecBModelOrigin(pev), pev->angles, edict() );

View file

@ -113,7 +113,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType )
} }
pev->effects |= EF_NODRAW; pev->effects |= EF_NODRAW;
SetThink( Smoke ); SetThink( &CGrenade::Smoke );
pev->velocity = g_vecZero; pev->velocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.3; pev->nextthink = gpGlobals->time + 0.3;
@ -156,7 +156,7 @@ void CGrenade::Killed( entvars_t *pevAttacker, int iGib )
// Timed grenade, this think is called when time runs out. // Timed grenade, this think is called when time runs out.
void CGrenade::DetonateUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void CGrenade::DetonateUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
SetThink( Detonate ); SetThink( &CGrenade::Detonate );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -164,7 +164,7 @@ void CGrenade::PreDetonate( void )
{ {
CSoundEnt::InsertSound ( bits_SOUND_DANGER, pev->origin, 400, 0.3 ); CSoundEnt::InsertSound ( bits_SOUND_DANGER, pev->origin, 400, 0.3 );
SetThink( Detonate ); SetThink( &CGrenade::Detonate );
pev->nextthink = gpGlobals->time + 1; pev->nextthink = gpGlobals->time + 1;
} }
@ -331,7 +331,7 @@ void CGrenade :: TumbleThink( void )
if (pev->dmgtime <= gpGlobals->time) if (pev->dmgtime <= gpGlobals->time)
{ {
SetThink( Detonate ); SetThink( &CGrenade::Detonate );
} }
if (pev->waterlevel != 0) if (pev->waterlevel != 0)
{ {
@ -366,14 +366,14 @@ CGrenade *CGrenade::ShootContact( entvars_t *pevOwner, Vector vecStart, Vector v
pGrenade->pev->owner = ENT(pevOwner); pGrenade->pev->owner = ENT(pevOwner);
// make monsters afaid of it while in the air // make monsters afaid of it while in the air
pGrenade->SetThink( DangerSoundThink ); pGrenade->SetThink( &CGrenade::DangerSoundThink );
pGrenade->pev->nextthink = gpGlobals->time; pGrenade->pev->nextthink = gpGlobals->time;
// Tumble in air // Tumble in air
pGrenade->pev->avelocity.x = RANDOM_FLOAT ( -100, -500 ); pGrenade->pev->avelocity.x = RANDOM_FLOAT ( -100, -500 );
// Explode on contact // Explode on contact
pGrenade->SetTouch( ExplodeTouch ); pGrenade->SetTouch( &CGrenade::ExplodeTouch );
pGrenade->pev->dmg = 50; pGrenade->pev->dmg = 50;
@ -390,14 +390,14 @@ CGrenade * CGrenade:: ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector v
pGrenade->pev->angles = UTIL_VecToAngles(pGrenade->pev->velocity); pGrenade->pev->angles = UTIL_VecToAngles(pGrenade->pev->velocity);
pGrenade->pev->owner = ENT(pevOwner); pGrenade->pev->owner = ENT(pevOwner);
pGrenade->SetTouch( BounceTouch ); // Bounce if touched pGrenade->SetTouch( &CGrenade::BounceTouch ); // Bounce if touched
// Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate // Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate
// will insert a DANGER sound into the world sound list and delay detonation for one second so that // will insert a DANGER sound into the world sound list and delay detonation for one second so that
// the grenade explodes after the exact amount of time specified in the call to ShootTimed(). // the grenade explodes after the exact amount of time specified in the call to ShootTimed().
pGrenade->pev->dmgtime = gpGlobals->time + time; pGrenade->pev->dmgtime = gpGlobals->time + time;
pGrenade->SetThink( TumbleThink ); pGrenade->SetThink( &CGrenade::TumbleThink );
pGrenade->pev->nextthink = gpGlobals->time + 0.1; pGrenade->pev->nextthink = gpGlobals->time + 0.1;
if (time < 0.1) if (time < 0.1)
{ {
@ -440,9 +440,9 @@ CGrenade * CGrenade :: ShootSatchelCharge( entvars_t *pevOwner, Vector vecStart,
pGrenade->pev->owner = ENT(pevOwner); pGrenade->pev->owner = ENT(pevOwner);
// Detonate in "time" seconds // Detonate in "time" seconds
pGrenade->SetThink( SUB_DoNothing ); pGrenade->SetThink( &CBaseEntity::SUB_DoNothing );
pGrenade->SetUse( DetonateUse ); pGrenade->SetUse( &CGrenade::DetonateUse );
pGrenade->SetTouch( SlideTouch ); pGrenade->SetTouch( &CGrenade::SlideTouch );
pGrenade->pev->spawnflags = SF_DETONATE; pGrenade->pev->spawnflags = SF_DETONATE;
pGrenade->pev->friction = 0.9; pGrenade->pev->friction = 0.9;

View file

@ -337,7 +337,7 @@ void CWeaponCycler::Spawn( )
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16)); UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16));
SetTouch( DefaultTouch ); SetTouch( &CBasePlayerItem::DefaultTouch );
} }

View file

@ -86,7 +86,7 @@ void CItem::Spawn( void )
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16)); UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16));
SetTouch(ItemTouch); SetTouch(&CItem::ItemTouch);
if (DROP_TO_FLOOR(ENT(pev)) == 0) if (DROP_TO_FLOOR(ENT(pev)) == 0)
{ {
@ -144,7 +144,7 @@ CBaseEntity* CItem::Respawn( void )
UTIL_SetOrigin( pev, g_pGameRules->VecItemRespawnSpot( this ) );// blip to whereever you should respawn. UTIL_SetOrigin( pev, g_pGameRules->VecItemRespawnSpot( this ) );// blip to whereever you should respawn.
SetThink ( Materialize ); SetThink ( &CItem::Materialize );
pev->nextthink = g_pGameRules->FlItemRespawnTime( this ); pev->nextthink = g_pGameRules->FlItemRespawnTime( this );
return this; return this;
} }
@ -157,6 +157,6 @@ void CItem::Materialize( void )
pev->effects |= EF_MUZZLEFLASH; pev->effects |= EF_MUZZLEFLASH;
} }
SetTouch( ItemTouch ); SetTouch( &CItem::ItemTouch );
} }

View file

@ -2011,9 +2011,9 @@ void CBaseMonster :: MonsterInit ( void )
// set eye position // set eye position
SetEyePosition(); SetEyePosition();
SetThink( MonsterInitThink ); SetThink( &CBaseMonster::MonsterInitThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetUse ( MonsterUse ); SetUse ( &CBaseMonster::MonsterUse );
} }
//========================================================= //=========================================================
@ -2110,7 +2110,7 @@ void CBaseMonster :: StartMonster ( void )
// Delay drop to floor to make sure each door in the level has had its chance to spawn // Delay drop to floor to make sure each door in the level has had its chance to spawn
// Spread think times so that they don't all happen at the same time (Carmack) // Spread think times so that they don't all happen at the same time (Carmack)
SetThink ( CallMonsterThink ); SetThink ( &CBaseMonster::CallMonsterThink );
pev->nextthink += RANDOM_FLOAT(0.1, 0.4); // spread think times. pev->nextthink += RANDOM_FLOAT(0.1, 0.4); // spread think times.
if ( !FStringNull(pev->targetname) )// wait until triggered if ( !FStringNull(pev->targetname) )// wait until triggered
@ -3232,7 +3232,7 @@ void CBaseMonster :: MonsterInitDead( void )
// Setup health counters, etc. // Setup health counters, etc.
BecomeDead(); BecomeDead();
SetThink( CorpseFallThink ); SetThink( &CBaseMonster::CorpseFallThink );
pev->nextthink = gpGlobals->time + 0.5; pev->nextthink = gpGlobals->time + 0.5;
} }

View file

@ -105,7 +105,7 @@ void CFuncMortarField :: Spawn( void )
SET_MODEL(ENT(pev), STRING(pev->model)); // set size and link into world SET_MODEL(ENT(pev), STRING(pev->model)); // set size and link into world
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
SetBits( pev->effects, EF_NODRAW ); SetBits( pev->effects, EF_NODRAW );
SetUse( FieldUse ); SetUse( &CFuncMortarField::FieldUse );
Precache(); Precache();
} }
@ -209,7 +209,7 @@ void CMortar::Spawn( )
pev->dmg = 200; pev->dmg = 200;
SetThink( MortarExplode ); SetThink( &CMortar::MortarExplode );
pev->nextthink = 0; pev->nextthink = 0;
Precache( ); Precache( );
@ -299,7 +299,7 @@ void CMortar::MortarExplode( void )
} }
*/ */
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
#endif #endif

View file

@ -1458,12 +1458,12 @@ void CTestHull :: Spawn( entvars_t *pevMasterNode )
if ( WorldGraph.m_fGraphPresent ) if ( WorldGraph.m_fGraphPresent )
{// graph loaded from disk, so we don't need the test hull {// graph loaded from disk, so we don't need the test hull
SetThink ( SUB_Remove ); SetThink ( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
else else
{ {
SetThink ( DropDelay ); SetThink ( &CTestHull::DropDelay );
pev->nextthink = gpGlobals->time + 1; pev->nextthink = gpGlobals->time + 1;
} }
@ -1483,7 +1483,7 @@ void CTestHull::DropDelay ( void )
UTIL_SetOrigin ( VARS(pev), WorldGraph.m_pNodes[ 0 ].m_vecOrigin ); UTIL_SetOrigin ( VARS(pev), WorldGraph.m_pNodes[ 0 ].m_vecOrigin );
SetThink ( CallBuildNodeGraph ); SetThink ( &CTestHull::CallBuildNodeGraph );
pev->nextthink = gpGlobals->time + 1; pev->nextthink = gpGlobals->time + 1;
} }
@ -1631,7 +1631,7 @@ void CTestHull :: BuildNodeGraph( void )
float flDist; float flDist;
int step; int step;
SetThink ( SUB_Remove );// no matter what happens, the hull gets rid of itself. SetThink ( &CBaseEntity::SUB_Remove );// no matter what happens, the hull gets rid of itself.
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
// malloc a swollen temporary connection pool that we trim down after we know exactly how many connections there are. // malloc a swollen temporary connection pool that we trim down after we know exactly how many connections there are.
@ -1743,7 +1743,7 @@ void CTestHull :: BuildNodeGraph( void )
{ {
ALERT ( at_aiconsole, "**ConnectVisibleNodes FAILED!\n" ); ALERT ( at_aiconsole, "**ConnectVisibleNodes FAILED!\n" );
SetThink ( ShowBadNode );// send the hull off to show the offending node. SetThink ( &CTestHull::ShowBadNode );// send the hull off to show the offending node.
//pev->solid = SOLID_NOT; //pev->solid = SOLID_NOT;
pev->origin = WorldGraph.m_pNodes[ iBadNode ].m_vecOrigin; pev->origin = WorldGraph.m_pNodes[ iBadNode ].m_vecOrigin;
@ -3558,7 +3558,7 @@ void CNodeViewer::Spawn( )
ALERT( at_aiconsole, "%d nodes\n", m_nVisited ); ALERT( at_aiconsole, "%d nodes\n", m_nVisited );
m_iDraw = 0; m_iDraw = 0;
SetThink( DrawThink ); SetThink( &CNodeViewer::DrawThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }

View file

@ -328,7 +328,7 @@ void CFuncPlat :: Spawn( )
{ {
UTIL_SetOrigin (pev, m_vecPosition1); UTIL_SetOrigin (pev, m_vecPosition1);
m_toggle_state = TS_AT_TOP; m_toggle_state = TS_AT_TOP;
SetUse( PlatUse ); SetUse( &CFuncPlat::PlatUse );
} }
else else
{ {
@ -435,7 +435,7 @@ void CFuncPlat :: GoDown( void )
ASSERT(m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP); ASSERT(m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP);
m_toggle_state = TS_GOING_DOWN; m_toggle_state = TS_GOING_DOWN;
SetMoveDone(CallHitBottom); SetMoveDone(&CFuncPlat::CallHitBottom);
LinearMove(m_vecPosition2, pev->speed); LinearMove(m_vecPosition2, pev->speed);
} }
@ -466,7 +466,7 @@ void CFuncPlat :: GoUp( void )
ASSERT(m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN); ASSERT(m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN);
m_toggle_state = TS_GOING_UP; m_toggle_state = TS_GOING_UP;
SetMoveDone(CallHitTop); SetMoveDone(&CFuncPlat::CallHitTop);
LinearMove(m_vecPosition1, pev->speed); LinearMove(m_vecPosition1, pev->speed);
} }
@ -488,7 +488,7 @@ void CFuncPlat :: HitTop( void )
if ( !IsTogglePlat() ) if ( !IsTogglePlat() )
{ {
// After a delay, the platform will automatically start going down again. // After a delay, the platform will automatically start going down again.
SetThink( CallGoDown ); SetThink( &CFuncPlat::CallGoDown );
pev->nextthink = pev->ltime + 3; pev->nextthink = pev->ltime + 3;
} }
} }
@ -738,7 +738,7 @@ void CFuncTrain :: Wait( void )
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING(pev->noiseMovement) ); STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING(pev->noiseMovement) );
if ( pev->noiseStopMoving ) if ( pev->noiseStopMoving )
EMIT_SOUND (ENT(pev), CHAN_VOICE, (char*)STRING(pev->noiseStopMoving), m_volume, ATTN_NORM); EMIT_SOUND (ENT(pev), CHAN_VOICE, (char*)STRING(pev->noiseStopMoving), m_volume, ATTN_NORM);
SetThink( Next ); SetThink( &CFuncTrain::Next );
} }
else else
{ {
@ -802,7 +802,7 @@ void CFuncTrain :: Next( void )
if ( pev->noiseMovement ) if ( pev->noiseMovement )
EMIT_SOUND (ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseMovement), m_volume, ATTN_NORM); EMIT_SOUND (ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseMovement), m_volume, ATTN_NORM);
ClearBits(pev->effects, EF_NOINTERP); ClearBits(pev->effects, EF_NOINTERP);
SetMoveDone( Wait ); SetMoveDone( &CFuncTrain::Wait );
LinearMove (pTarg->pev->origin - (pev->mins + pev->maxs)* 0.5, pev->speed); LinearMove (pTarg->pev->origin - (pev->mins + pev->maxs)* 0.5, pev->speed);
} }
} }
@ -824,7 +824,7 @@ void CFuncTrain :: Activate( void )
if ( FStringNull(pev->targetname) ) if ( FStringNull(pev->targetname) )
{ // not triggered, so start immediately { // not triggered, so start immediately
pev->nextthink = pev->ltime + 0.1; pev->nextthink = pev->ltime + 0.1;
SetThink( Next ); SetThink( &CFuncTrain::Next );
} }
else else
pev->spawnflags |= SF_TRAIN_WAIT_RETRIGGER; pev->spawnflags |= SF_TRAIN_WAIT_RETRIGGER;
@ -920,7 +920,7 @@ void CFuncTrain::OverrideReset( void )
} }
else // Keep moving for 0.1 secs, then find path_corner again and restart else // Keep moving for 0.1 secs, then find path_corner again and restart
{ {
SetThink( Next ); SetThink( &CFuncTrain::Next );
pev->nextthink = pev->ltime + 0.1; pev->nextthink = pev->ltime + 0.1;
} }
} }
@ -1262,7 +1262,7 @@ void CFuncTrackTrain :: Next( void )
} }
} }
SetThink( Next ); SetThink( &CFuncTrackTrain::Next );
NextThink( pev->ltime + time, TRUE ); NextThink( pev->ltime + time, TRUE );
} }
else // end of path, stop else // end of path, stop
@ -1284,7 +1284,7 @@ void CFuncTrackTrain :: Next( void )
// no, how long to get there? // no, how long to get there?
time = distance / m_oldSpeed; time = distance / m_oldSpeed;
pev->velocity = pev->velocity * (m_oldSpeed / distance); pev->velocity = pev->velocity * (m_oldSpeed / distance);
SetThink( DeadEnd ); SetThink( &CFuncTrackTrain::DeadEnd );
NextThink( pev->ltime + time, FALSE ); NextThink( pev->ltime + time, FALSE );
} }
else else
@ -1402,7 +1402,7 @@ void CFuncTrackTrain :: Find( void )
pev->angles.x = 0; pev->angles.x = 0;
UTIL_SetOrigin( pev, nextPos ); UTIL_SetOrigin( pev, nextPos );
NextThink( pev->ltime + 0.1, FALSE ); NextThink( pev->ltime + 0.1, FALSE );
SetThink( Next ); SetThink( &CFuncTrackTrain::Next );
pev->speed = m_startSpeed; pev->speed = m_startSpeed;
UpdateSound(); UpdateSound();
@ -1452,7 +1452,7 @@ void CFuncTrackTrain :: NearestPath( void )
if ( pev->speed != 0 ) if ( pev->speed != 0 )
{ {
NextThink( pev->ltime + 0.1, FALSE ); NextThink( pev->ltime + 0.1, FALSE );
SetThink( Next ); SetThink( &CFuncTrackTrain::Next );
} }
} }
@ -1460,7 +1460,7 @@ void CFuncTrackTrain :: NearestPath( void )
void CFuncTrackTrain::OverrideReset( void ) void CFuncTrackTrain::OverrideReset( void )
{ {
NextThink( pev->ltime + 0.1, FALSE ); NextThink( pev->ltime + 0.1, FALSE );
SetThink( NearestPath ); SetThink( &CFuncTrackTrain::NearestPath );
} }
@ -1519,7 +1519,7 @@ void CFuncTrackTrain :: Spawn( void )
// start trains on the next frame, to make sure their targets have had // start trains on the next frame, to make sure their targets have had
// a chance to spawn/activate // a chance to spawn/activate
NextThink( pev->ltime + 0.1, FALSE ); NextThink( pev->ltime + 0.1, FALSE );
SetThink( Find ); SetThink( &CFuncTrackTrain::Find );
Precache(); Precache();
} }
@ -1589,7 +1589,7 @@ void CFuncTrainControls :: Spawn( void )
UTIL_SetSize( pev, pev->mins, pev->maxs ); UTIL_SetSize( pev, pev->mins, pev->maxs );
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
SetThink( Find ); SetThink(&CFuncTrainControls::Find );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -1701,7 +1701,7 @@ void CFuncTrackChange :: Spawn( void )
EnableUse(); EnableUse();
pev->nextthink = pev->ltime + 2.0; pev->nextthink = pev->ltime + 2.0;
SetThink( Find ); SetThink( &CFuncTrackChange::Find );
Precache(); Precache();
} }
@ -1752,7 +1752,7 @@ void CFuncTrackChange :: KeyValue( KeyValueData *pkvd )
void CFuncTrackChange::OverrideReset( void ) void CFuncTrackChange::OverrideReset( void )
{ {
pev->nextthink = pev->ltime + 1.0; pev->nextthink = pev->ltime + 1.0;
SetThink( Find ); SetThink( &CFuncTrackChange::Find );
} }
void CFuncTrackChange :: Find( void ) void CFuncTrackChange :: Find( void )
@ -1862,14 +1862,14 @@ void CFuncTrackChange :: GoDown( void )
// If ROTMOVE, move & rotate // If ROTMOVE, move & rotate
if ( FBitSet( pev->spawnflags, SF_TRACK_DONT_MOVE ) ) if ( FBitSet( pev->spawnflags, SF_TRACK_DONT_MOVE ) )
{ {
SetMoveDone( CallHitBottom ); SetMoveDone( &CFuncTrackChange::CallHitBottom );
m_toggle_state = TS_GOING_DOWN; m_toggle_state = TS_GOING_DOWN;
AngularMove( m_start, pev->speed ); AngularMove( m_start, pev->speed );
} }
else else
{ {
CFuncPlat :: GoDown(); CFuncPlat :: GoDown();
SetMoveDone( CallHitBottom ); SetMoveDone( &CFuncTrackChange::CallHitBottom );
RotMove( m_start, pev->nextthink - pev->ltime ); RotMove( m_start, pev->nextthink - pev->ltime );
} }
// Otherwise, rotate first, move second // Otherwise, rotate first, move second
@ -1898,14 +1898,14 @@ void CFuncTrackChange :: GoUp( void )
if ( FBitSet( pev->spawnflags, SF_TRACK_DONT_MOVE ) ) if ( FBitSet( pev->spawnflags, SF_TRACK_DONT_MOVE ) )
{ {
m_toggle_state = TS_GOING_UP; m_toggle_state = TS_GOING_UP;
SetMoveDone( CallHitTop ); SetMoveDone( &CFuncTrackChange::CallHitTop );
AngularMove( m_end, pev->speed ); AngularMove( m_end, pev->speed );
} }
else else
{ {
// If ROTMOVE, move & rotate // If ROTMOVE, move & rotate
CFuncPlat :: GoUp(); CFuncPlat :: GoUp();
SetMoveDone( CallHitTop ); SetMoveDone( &CFuncTrackChange::CallHitTop );
RotMove( m_end, pev->nextthink - pev->ltime ); RotMove( m_end, pev->nextthink - pev->ltime );
} }
@ -2160,7 +2160,7 @@ void CGunTarget::Spawn( void )
if ( pev->spawnflags & FGUNTARGET_START_ON ) if ( pev->spawnflags & FGUNTARGET_START_ON )
{ {
SetThink( Start ); SetThink( &CGunTarget::Start );
pev->nextthink = pev->ltime + 0.3; pev->nextthink = pev->ltime + 0.3;
} }
} }
@ -2198,7 +2198,7 @@ void CGunTarget::Next( void )
Stop(); Stop();
return; return;
} }
SetMoveDone( Wait ); SetMoveDone( &CGunTarget::Wait );
LinearMove( pTarget->pev->origin - (pev->mins + pev->maxs) * 0.5, pev->speed ); LinearMove( pTarget->pev->origin - (pev->mins + pev->maxs) * 0.5, pev->speed );
} }
@ -2224,7 +2224,7 @@ void CGunTarget::Wait( void )
m_flWait = pTarget->GetDelay(); m_flWait = pTarget->GetDelay();
pev->target = pTarget->pev->target; pev->target = pTarget->pev->target;
SetThink( Next ); SetThink( &CGunTarget::Next );
if (m_flWait != 0) if (m_flWait != 0)
{// -1 wait will wait forever! {// -1 wait will wait forever!
pev->nextthink = pev->ltime + m_flWait; pev->nextthink = pev->ltime + m_flWait;

View file

@ -1049,7 +1049,7 @@ void CBasePlayer::PackDeadPlayerItems( void )
pWeaponBox->pev->angles.x = 0 ;// don't let weaponbox tilt. pWeaponBox->pev->angles.x = 0 ;// don't let weaponbox tilt.
pWeaponBox->pev->angles.z = 0; pWeaponBox->pev->angles.z = 0;
pWeaponBox->SetThink( CWeaponBox::Kill ); pWeaponBox->SetThink( &CWeaponBox::Kill );
pWeaponBox->pev->nextthink = gpGlobals->time + 120; pWeaponBox->pev->nextthink = gpGlobals->time + 120;
// pWeaponBox->pev->velocity = pev->velocity * 1.2;// weaponbox has player's velocity, then some. // pWeaponBox->pev->velocity = pev->velocity * 1.2;// weaponbox has player's velocity, then some.
@ -1187,7 +1187,7 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib )
pev->angles.x = 0; pev->angles.x = 0;
pev->angles.z = 0; pev->angles.z = 0;
SetThink(PlayerDeathThink); SetThink(&CBasePlayer::PlayerDeathThink);
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -3240,7 +3240,7 @@ void CBloodSplat::Spawn ( entvars_t *pevOwner )
pev->angles = pevOwner->v_angle; pev->angles = pevOwner->v_angle;
pev->owner = ENT(pevOwner); pev->owner = ENT(pevOwner);
SetThink ( Spray ); SetThink ( &CBloodSplat::Spray );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -3255,7 +3255,7 @@ void CBloodSplat::Spray ( void )
UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED ); UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED );
// } // }
SetThink ( SUB_Remove ); SetThink ( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -3581,7 +3581,7 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse )
if ( pEntity ) if ( pEntity )
{ {
if ( pEntity->pev->takedamage ) if ( pEntity->pev->takedamage )
pEntity->SetThink(SUB_Remove); pEntity->SetThink(&CBaseEntity::SUB_Remove);
} }
break; break;
} }
@ -4551,7 +4551,7 @@ void CRevertSaved :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
{ {
UTIL_ScreenFadeAll( pev->rendercolor, Duration(), HoldTime(), pev->renderamt, FFADE_OUT ); UTIL_ScreenFadeAll( pev->rendercolor, Duration(), HoldTime(), pev->renderamt, FFADE_OUT );
pev->nextthink = gpGlobals->time + MessageTime(); pev->nextthink = gpGlobals->time + MessageTime();
SetThink( MessageThink ); SetThink( &CRevertSaved::MessageThink );
} }
@ -4562,7 +4562,7 @@ void CRevertSaved :: MessageThink( void )
if ( nextThink > 0 ) if ( nextThink > 0 )
{ {
pev->nextthink = gpGlobals->time + nextThink; pev->nextthink = gpGlobals->time + nextThink;
SetThink( LoadThink ); SetThink( &CRevertSaved::LoadThink );
} }
else else
LoadThink(); LoadThink();

View file

@ -339,7 +339,7 @@ public:
void SetCustomDecalFrames( int nFrames ); void SetCustomDecalFrames( int nFrames );
int GetCustomDecalFrames( void ); int GetCustomDecalFrames( void );
void CBasePlayer::TabulateAmmo( void ); void TabulateAmmo( void );
}; };
#define AUTOAIM_2DEGREES 0.0348994967025 #define AUTOAIM_2DEGREES 0.0348994967025

View file

@ -139,7 +139,7 @@ void CCineMonster :: Spawn( void )
// if no targetname, start now // if no targetname, start now
if ( FStringNull(pev->targetname) || !FStringNull( m_iszIdle ) ) if ( FStringNull(pev->targetname) || !FStringNull( m_iszIdle ) )
{ {
SetThink( CineThink ); SetThink( &CCineMonster::CineThink );
pev->nextthink = gpGlobals->time + 1.0; pev->nextthink = gpGlobals->time + 1.0;
// Wait to be used? // Wait to be used?
if ( pev->targetname ) if ( pev->targetname )
@ -195,7 +195,7 @@ void CCineMonster :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
else else
{ {
// if not, try finding them // if not, try finding them
SetThink( CineThink ); SetThink( &CCineMonster::CineThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
} }
@ -250,7 +250,7 @@ void CCineMonster :: Touch( CBaseEntity *pOther )
// //
void CCineMonster :: Die( void ) void CCineMonster :: Die( void )
{ {
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
} }
// //
@ -553,7 +553,7 @@ void CCineMonster :: SequenceDone ( CBaseMonster *pMonster )
if ( !( pev->spawnflags & SF_SCRIPT_REPEATABLE ) ) if ( !( pev->spawnflags & SF_SCRIPT_REPEATABLE ) )
{ {
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -819,7 +819,7 @@ BOOL CBaseMonster :: CineCleanup( )
SetTouch( NULL ); SetTouch( NULL );
} }
else else
SUB_StartFadeOut(); // SetThink( SUB_DoNothing ); SUB_StartFadeOut(); // SetThink( &CBaseEntity::SUB_DoNothing );
// This turns off animation & physics in case their origin ends up stuck in the world or something // This turns off animation & physics in case their origin ends up stuck in the world or something
StopAnimation(); StopAnimation();
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -1013,7 +1013,7 @@ void CScriptedSentence :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, US
if ( !m_active ) if ( !m_active )
return; return;
// ALERT( at_console, "Firing sentence: %s\n", STRING(m_iszSentence) ); // ALERT( at_console, "Firing sentence: %s\n", STRING(m_iszSentence) );
SetThink( FindThink ); SetThink( &CScriptedSentence::FindThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -1026,7 +1026,7 @@ void CScriptedSentence :: Spawn( void )
// if no targetname, start now // if no targetname, start now
if ( !pev->targetname ) if ( !pev->targetname )
{ {
SetThink( FindThink ); SetThink( &CScriptedSentence::FindThink );
pev->nextthink = gpGlobals->time + 1.0; pev->nextthink = gpGlobals->time + 1.0;
} }
@ -1065,7 +1065,7 @@ void CScriptedSentence :: FindThink( void )
StartSentence( pMonster ); StartSentence( pMonster );
if ( pev->spawnflags & SF_SENTENCE_ONCE ) if ( pev->spawnflags & SF_SENTENCE_ONCE )
UTIL_Remove( this ); UTIL_Remove( this );
SetThink( DelayThink ); SetThink( &CScriptedSentence::DelayThink );
pev->nextthink = gpGlobals->time + m_flDuration + m_flRepeat; pev->nextthink = gpGlobals->time + m_flDuration + m_flRepeat;
m_active = FALSE; m_active = FALSE;
// ALERT( at_console, "%s: found monster %s\n", STRING(m_iszSentence), STRING(m_iszEntity) ); // ALERT( at_console, "%s: found monster %s\n", STRING(m_iszSentence), STRING(m_iszEntity) );
@ -1083,7 +1083,7 @@ void CScriptedSentence :: DelayThink( void )
m_active = TRUE; m_active = TRUE;
if ( !pev->targetname ) if ( !pev->targetname )
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetThink( FindThink ); SetThink( &CScriptedSentence::FindThink );
} }
@ -1206,7 +1206,7 @@ LINK_ENTITY_TO_CLASS( monster_furniture, CFurniture );
//========================================================= //=========================================================
void CFurniture :: Die ( void ) void CFurniture :: Die ( void )
{ {
SetThink ( SUB_Remove ); SetThink ( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }

View file

@ -192,7 +192,7 @@ void CAmbientGeneric :: Spawn( void )
{ {
ALERT( at_error, "EMPTY AMBIENT AT: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z ); ALERT( at_error, "EMPTY AMBIENT AT: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
return; return;
} }
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
@ -202,12 +202,12 @@ void CAmbientGeneric :: Spawn( void )
// of ambient sound's pitch or volume. Don't // of ambient sound's pitch or volume. Don't
// start thinking yet. // start thinking yet.
SetThink(RampThink); SetThink(&CAmbientGeneric::RampThink);
pev->nextthink = 0; pev->nextthink = 0;
// allow on/off switching via 'use' function. // allow on/off switching via 'use' function.
SetUse ( ToggleUse ); SetUse ( &CAmbientGeneric::ToggleUse );
m_fActive = FALSE; m_fActive = FALSE;
@ -1810,19 +1810,19 @@ void CSpeaker :: Spawn( void )
{ {
ALERT( at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z ); ALERT( at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
return; return;
} }
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
SetThink(SpeakerThink); SetThink(&CSpeaker::SpeakerThink);
pev->nextthink = 0.0; pev->nextthink = 0.0;
// allow on/off switching via 'use' function. // allow on/off switching via 'use' function.
SetUse ( ToggleUse ); SetUse ( &CSpeaker::ToggleUse );
Precache( ); Precache( );
} }

View file

@ -231,7 +231,7 @@ void CBaseDelay :: SUB_UseTargets( CBaseEntity *pActivator, USE_TYPE useType, fl
pTemp->pev->nextthink = gpGlobals->time + m_flDelay; pTemp->pev->nextthink = gpGlobals->time + m_flDelay;
pTemp->SetThink( DelayThink ); pTemp->SetThink( &CBaseDelay::DelayThink );
// Save the useType // Save the useType
pTemp->pev->button = (int)useType; pTemp->pev->button = (int)useType;
@ -413,7 +413,7 @@ void CBaseToggle :: LinearMove( Vector vecDest, float flSpeed )
// set nextthink to trigger a call to LinearMoveDone when dest is reached // set nextthink to trigger a call to LinearMoveDone when dest is reached
pev->nextthink = pev->ltime + flTravelTime; pev->nextthink = pev->ltime + flTravelTime;
SetThink( LinearMoveDone ); SetThink( &CBaseToggle::LinearMoveDone );
// scale the destdelta vector by the time spent traveling to get velocity // scale the destdelta vector by the time spent traveling to get velocity
pev->velocity = vecDestDelta / flTravelTime; pev->velocity = vecDestDelta / flTravelTime;
@ -473,7 +473,7 @@ void CBaseToggle :: AngularMove( Vector vecDestAngle, float flSpeed )
// set nextthink to trigger a call to AngularMoveDone when dest is reached // set nextthink to trigger a call to AngularMoveDone when dest is reached
pev->nextthink = pev->ltime + flTravelTime; pev->nextthink = pev->ltime + flTravelTime;
SetThink( AngularMoveDone ); SetThink( &CBaseToggle::AngularMoveDone );
// scale the destdelta vector by the time spent traveling to get velocity // scale the destdelta vector by the time spent traveling to get velocity
pev->avelocity = vecDestDelta / flTravelTime; pev->avelocity = vecDestDelta / flTravelTime;

View file

@ -73,7 +73,7 @@ void CFrictionModifier :: Spawn( void )
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
SET_MODEL(ENT(pev), STRING(pev->model)); // set size and link into world SET_MODEL(ENT(pev), STRING(pev->model)); // set size and link into world
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
SetTouch( ChangeFriction ); SetTouch( &CFrictionModifier::ChangeFriction );
} }
@ -344,8 +344,8 @@ void CMultiManager :: KeyValue( KeyValueData *pkvd )
void CMultiManager :: Spawn( void ) void CMultiManager :: Spawn( void )
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
SetUse ( ManagerUse ); SetUse ( &CMultiManager::ManagerUse );
SetThink ( ManagerThink); SetThink ( &CMultiManager::ManagerThink);
// Sort targets // Sort targets
// Quick and dirty bubble sort // Quick and dirty bubble sort
@ -403,7 +403,7 @@ void CMultiManager :: ManagerThink ( void )
UTIL_Remove( this ); UTIL_Remove( this );
return; return;
} }
SetUse ( ManagerUse );// allow manager re-use SetUse ( &CMultiManager::ManagerUse );// allow manager re-use
} }
else else
pev->nextthink = m_startTime + m_flTargetDelay[ m_index ]; pev->nextthink = m_startTime + m_flTargetDelay[ m_index ];
@ -444,7 +444,7 @@ void CMultiManager :: ManagerUse ( CBaseEntity *pActivator, CBaseEntity *pCaller
SetUse( NULL );// disable use until all targets have fired SetUse( NULL );// disable use until all targets have fired
SetThink ( ManagerThink ); SetThink ( &CMultiManager::ManagerThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -618,7 +618,7 @@ void CTriggerMonsterJump :: Spawn ( void )
{// if targetted, spawn turned off {// if targetted, spawn turned off
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
UTIL_SetOrigin( pev, pev->origin ); // Unlink from trigger list UTIL_SetOrigin( pev, pev->origin ); // Unlink from trigger list
SetUse( ToggleUse ); SetUse( &CTriggerMonsterJump::ToggleUse );
} }
} }
@ -808,11 +808,11 @@ void CTargetCDAudio::Play( void )
void CTriggerHurt :: Spawn( void ) void CTriggerHurt :: Spawn( void )
{ {
InitTrigger(); InitTrigger();
SetTouch ( HurtTouch ); SetTouch ( &CTriggerHurt::HurtTouch );
if ( !FStringNull ( pev->targetname ) ) if ( !FStringNull ( pev->targetname ) )
{ {
SetUse ( ToggleUse ); SetUse ( &CTriggerHurt::ToggleUse );
} }
else else
{ {
@ -821,7 +821,7 @@ void CTriggerHurt :: Spawn( void )
if (m_bitsDamageInflict & DMG_RADIATION) if (m_bitsDamageInflict & DMG_RADIATION)
{ {
SetThink ( RadiationThink ); SetThink ( &CTriggerHurt::RadiationThink );
pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5); pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5);
} }
@ -1071,7 +1071,7 @@ void CTriggerMultiple :: Spawn( void )
// } // }
// else // else
{ {
SetTouch( MultiTouch ); SetTouch( &CTriggerMultiple::MultiTouch );
} }
} }
@ -1168,7 +1168,7 @@ void CBaseTrigger :: ActivateMultiTrigger( CBaseEntity *pActivator )
if (m_flWait > 0) if (m_flWait > 0)
{ {
SetThink( MultiWaitOver ); SetThink( &CBaseTrigger::MultiWaitOver );
pev->nextthink = gpGlobals->time + m_flWait; pev->nextthink = gpGlobals->time + m_flWait;
} }
else else
@ -1177,7 +1177,7 @@ void CBaseTrigger :: ActivateMultiTrigger( CBaseEntity *pActivator )
// called while C code is looping through area links... // called while C code is looping through area links...
SetTouch( NULL ); SetTouch( NULL );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetThink( SUB_Remove ); SetThink( &CBaseTrigger::SUB_Remove );
} }
} }
@ -1256,7 +1256,7 @@ void CTriggerCounter :: Spawn( void )
if (m_cTriggersLeft == 0) if (m_cTriggersLeft == 0)
m_cTriggersLeft = 2; m_cTriggersLeft = 2;
SetUse( CounterUse ); SetUse( &CTriggerCounter::CounterUse );
} }
// ====================== TRIGGER_CHANGELEVEL ================================ // ====================== TRIGGER_CHANGELEVEL ================================
@ -1401,11 +1401,11 @@ void CChangeLevel :: Spawn( void )
if (!FStringNull ( pev->targetname ) ) if (!FStringNull ( pev->targetname ) )
{ {
SetUse ( UseChangeLevel ); SetUse ( &CChangeLevel::UseChangeLevel );
} }
InitTrigger(); InitTrigger();
if ( !(pev->spawnflags & SF_CHANGELEVEL_USEONLY) ) if ( !(pev->spawnflags & SF_CHANGELEVEL_USEONLY) )
SetTouch( TouchChangeLevel ); SetTouch( &CChangeLevel::TouchChangeLevel );
// ALERT( at_console, "TRANSITION: %s (%s)\n", m_szMapName, m_szLandmarkName ); // ALERT( at_console, "TRANSITION: %s (%s)\n", m_szMapName, m_szLandmarkName );
} }
@ -1722,7 +1722,7 @@ void NextLevel( void )
if (pChange->pev->nextthink < gpGlobals->time) if (pChange->pev->nextthink < gpGlobals->time)
{ {
pChange->SetThink( CChangeLevel::ExecuteChangeLevel ); pChange->SetThink( &CChangeLevel::ExecuteChangeLevel );
pChange->pev->nextthink = gpGlobals->time + 0.1; pChange->pev->nextthink = gpGlobals->time + 0.1;
} }
} }
@ -1806,7 +1806,7 @@ void CTriggerPush :: Spawn( )
if ( FBitSet (pev->spawnflags, SF_TRIGGER_PUSH_START_OFF) )// if flagged to Start Turned Off, make trigger nonsolid. if ( FBitSet (pev->spawnflags, SF_TRIGGER_PUSH_START_OFF) )// if flagged to Start Turned Off, make trigger nonsolid.
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
SetUse( ToggleUse ); SetUse( &CTriggerPush::ToggleUse );
UTIL_SetOrigin( pev, pev->origin ); // Link into the list UTIL_SetOrigin( pev, pev->origin ); // Link into the list
} }
@ -1924,7 +1924,7 @@ void CTriggerTeleport :: Spawn( void )
{ {
InitTrigger(); InitTrigger();
SetTouch( TeleportTouch ); SetTouch( &CTriggerTeleport::TeleportTouch );
} }
@ -1949,7 +1949,7 @@ void CTriggerSave::Spawn( void )
} }
InitTrigger(); InitTrigger();
SetTouch( SaveTouch ); SetTouch( &CTriggerSave::SaveTouch );
} }
void CTriggerSave::SaveTouch( CBaseEntity *pOther ) void CTriggerSave::SaveTouch( CBaseEntity *pOther )
@ -2004,10 +2004,10 @@ void CTriggerEndSection::Spawn( void )
InitTrigger(); InitTrigger();
SetUse ( EndSectionUse ); SetUse ( &CTriggerEndSection::EndSectionUse );
// If it is a "use only" trigger, then don't set the touch function. // If it is a "use only" trigger, then don't set the touch function.
if ( ! (pev->spawnflags & SF_ENDSECTION_USEONLY) ) if ( ! (pev->spawnflags & SF_ENDSECTION_USEONLY) )
SetTouch( EndSectionTouch ); SetTouch( &CTriggerEndSection::EndSectionTouch );
} }
void CTriggerEndSection::EndSectionTouch( CBaseEntity *pOther ) void CTriggerEndSection::EndSectionTouch( CBaseEntity *pOther )
@ -2050,7 +2050,7 @@ LINK_ENTITY_TO_CLASS( trigger_gravity, CTriggerGravity );
void CTriggerGravity::Spawn( void ) void CTriggerGravity::Spawn( void )
{ {
InitTrigger(); InitTrigger();
SetTouch( GravityTouch ); SetTouch( &CTriggerGravity::GravityTouch );
} }
void CTriggerGravity::GravityTouch( CBaseEntity *pOther ) void CTriggerGravity::GravityTouch( CBaseEntity *pOther )
@ -2307,7 +2307,7 @@ void CTriggerCamera::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
SET_MODEL(ENT(pev), STRING(pActivator->pev->model) ); SET_MODEL(ENT(pev), STRING(pActivator->pev->model) );
// follow the player down // follow the player down
SetThink( FollowTarget ); SetThink( &CTriggerCamera::FollowTarget );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
m_moveDistance = 0; m_moveDistance = 0;

View file

@ -257,7 +257,7 @@ void CBaseTurret::Spawn()
pev->takedamage = DAMAGE_AIM; pev->takedamage = DAMAGE_AIM;
SetBits (pev->flags, FL_MONSTER); SetBits (pev->flags, FL_MONSTER);
SetUse( TurretUse ); SetUse( &CBaseTurret::TurretUse );
if (( pev->spawnflags & SF_MONSTER_TURRET_AUTOACTIVATE ) if (( pev->spawnflags & SF_MONSTER_TURRET_AUTOACTIVATE )
&& !( pev->spawnflags & SF_MONSTER_TURRET_STARTINACTIVE )) && !( pev->spawnflags & SF_MONSTER_TURRET_STARTINACTIVE ))
@ -307,7 +307,7 @@ void CTurret::Spawn()
m_iMinPitch = -15; m_iMinPitch = -15;
UTIL_SetSize(pev, Vector(-32, -32, -m_iRetractHeight), Vector(32, 32, m_iRetractHeight)); UTIL_SetSize(pev, Vector(-32, -32, -m_iRetractHeight), Vector(32, 32, m_iRetractHeight));
SetThink(Initialize); SetThink(&CBaseTurret::Initialize);
m_pEyeGlow = CSprite::SpriteCreate( TURRET_GLOW_SPRITE, pev->origin, FALSE ); m_pEyeGlow = CSprite::SpriteCreate( TURRET_GLOW_SPRITE, pev->origin, FALSE );
m_pEyeGlow->SetTransparency( kRenderGlow, 255, 0, 0, 0, kRenderFxNoDissipation ); m_pEyeGlow->SetTransparency( kRenderGlow, 255, 0, 0, 0, kRenderFxNoDissipation );
@ -339,7 +339,7 @@ void CMiniTurret::Spawn()
m_iMinPitch = -15; m_iMinPitch = -15;
UTIL_SetSize(pev, Vector(-16, -16, -m_iRetractHeight), Vector(16, 16, m_iRetractHeight)); UTIL_SetSize(pev, Vector(-16, -16, -m_iRetractHeight), Vector(16, 16, m_iRetractHeight));
SetThink(Initialize); SetThink(&CBaseTurret::Initialize);
pev->nextthink = gpGlobals->time + 0.3; pev->nextthink = gpGlobals->time + 0.3;
} }
@ -381,11 +381,11 @@ void CBaseTurret::Initialize(void)
if (m_iAutoStart) if (m_iAutoStart)
{ {
m_flLastSight = gpGlobals->time + m_flMaxWait; m_flLastSight = gpGlobals->time + m_flMaxWait;
SetThink(AutoSearchThink); SetThink(&CBaseTurret::AutoSearchThink);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
else else
SetThink(SUB_DoNothing); SetThink(&CBaseEntity::SUB_DoNothing);
} }
void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
@ -399,7 +399,7 @@ void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
m_iAutoStart = FALSE;// switching off a turret disables autostart m_iAutoStart = FALSE;// switching off a turret disables autostart
//!!!! this should spin down first!!BUGBUG //!!!! this should spin down first!!BUGBUG
SetThink(Retire); SetThink(&CBaseTurret::Retire);
} }
else else
{ {
@ -411,7 +411,7 @@ void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_
m_iAutoStart = TRUE; m_iAutoStart = TRUE;
} }
SetThink(Deploy); SetThink(&CBaseTurret::Deploy);
} }
} }
@ -472,7 +472,7 @@ void CBaseTurret::ActiveThink(void)
{ {
m_hEnemy = NULL; m_hEnemy = NULL;
m_flLastSight = gpGlobals->time + m_flMaxWait; m_flLastSight = gpGlobals->time + m_flMaxWait;
SetThink(SearchThink); SetThink(&CBaseTurret::SearchThink);
return; return;
} }
@ -489,7 +489,7 @@ void CBaseTurret::ActiveThink(void)
{ {
m_hEnemy = NULL; m_hEnemy = NULL;
m_flLastSight = gpGlobals->time + m_flMaxWait; m_flLastSight = gpGlobals->time + m_flMaxWait;
SetThink(SearchThink); SetThink(&CBaseTurret::SearchThink);
return; return;
} }
} }
@ -518,7 +518,7 @@ void CBaseTurret::ActiveThink(void)
{ {
m_hEnemy = NULL; m_hEnemy = NULL;
m_flLastSight = gpGlobals->time + m_flMaxWait; m_flLastSight = gpGlobals->time + m_flMaxWait;
SetThink(SearchThink); SetThink(&CBaseTurret::SearchThink);
return; return;
} }
} }
@ -683,7 +683,7 @@ void CBaseTurret::Deploy(void)
SetTurretAnim(TURRET_ANIM_SPIN); SetTurretAnim(TURRET_ANIM_SPIN);
pev->framerate = 0; pev->framerate = 0;
SetThink(SearchThink); SetThink(&CBaseTurret::SearchThink);
} }
m_flLastSight = gpGlobals->time + m_flMaxWait; m_flLastSight = gpGlobals->time + m_flMaxWait;
@ -723,11 +723,11 @@ void CBaseTurret::Retire(void)
UTIL_SetSize(pev, pev->mins, pev->maxs); UTIL_SetSize(pev, pev->mins, pev->maxs);
if (m_iAutoStart) if (m_iAutoStart)
{ {
SetThink(AutoSearchThink); SetThink(&CBaseTurret::AutoSearchThink);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
else else
SetThink(SUB_DoNothing); SetThink(&CBaseEntity::SUB_DoNothing);
} }
} }
else else
@ -759,7 +759,7 @@ void CTurret::SpinUpCall(void)
{ {
pev->nextthink = gpGlobals->time + 0.1; // retarget delay pev->nextthink = gpGlobals->time + 0.1; // retarget delay
EMIT_SOUND(ENT(pev), CHAN_STATIC, "turret/tu_active2.wav", TURRET_MACHINE_VOLUME, ATTN_NORM); EMIT_SOUND(ENT(pev), CHAN_STATIC, "turret/tu_active2.wav", TURRET_MACHINE_VOLUME, ATTN_NORM);
SetThink(ActiveThink); SetThink(&CBaseTurret::ActiveThink);
m_iStartSpin = 0; m_iStartSpin = 0;
m_iSpin = 1; m_iSpin = 1;
} }
@ -771,7 +771,7 @@ void CTurret::SpinUpCall(void)
if (m_iSpin) if (m_iSpin)
{ {
SetThink(ActiveThink); SetThink(&CBaseTurret::ActiveThink);
} }
} }
@ -869,7 +869,7 @@ void CBaseTurret::SearchThink(void)
{ {
m_flLastSight = 0; m_flLastSight = 0;
m_flSpinUpTime = 0; m_flSpinUpTime = 0;
SetThink(ActiveThink); SetThink(&CBaseTurret::ActiveThink);
} }
else else
{ {
@ -879,7 +879,7 @@ void CBaseTurret::SearchThink(void)
//Before we retrace, make sure that we are spun down. //Before we retrace, make sure that we are spun down.
m_flLastSight = 0; m_flLastSight = 0;
m_flSpinUpTime = 0; m_flSpinUpTime = 0;
SetThink(Retire); SetThink(&CBaseTurret::Retire);
} }
// should we stop the spin? // should we stop the spin?
else if ((m_flSpinUpTime) && (gpGlobals->time > m_flSpinUpTime)) else if ((m_flSpinUpTime) && (gpGlobals->time > m_flSpinUpTime))
@ -924,7 +924,7 @@ void CBaseTurret::AutoSearchThink(void)
if (m_hEnemy != NULL) if (m_hEnemy != NULL)
{ {
SetThink(Deploy); SetThink(&CBaseTurret::Deploy);
EMIT_SOUND(ENT(pev), CHAN_BODY, "turret/tu_alert.wav", TURRET_MACHINE_VOLUME, ATTN_NORM); EMIT_SOUND(ENT(pev), CHAN_BODY, "turret/tu_alert.wav", TURRET_MACHINE_VOLUME, ATTN_NORM);
} }
} }
@ -1038,7 +1038,7 @@ int CBaseTurret::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, flo
ClearBits (pev->flags, FL_MONSTER); // why are they set in the first place??? ClearBits (pev->flags, FL_MONSTER); // why are they set in the first place???
SetUse(NULL); SetUse(NULL);
SetThink(TurretDeath); SetThink(&CBaseTurret::TurretDeath);
SUB_UseTargets( this, USE_ON, 0 ); // wake up others SUB_UseTargets( this, USE_ON, 0 ); // wake up others
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
@ -1050,7 +1050,7 @@ int CBaseTurret::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, flo
if (m_iOn && (1 || RANDOM_LONG(0, 0x7FFF) > 800)) if (m_iOn && (1 || RANDOM_LONG(0, 0x7FFF) > 800))
{ {
m_fBeserk = 1; m_fBeserk = 1;
SetThink(SearchThink); SetThink(&CBaseTurret::SearchThink);
} }
} }
@ -1192,8 +1192,8 @@ void CSentry::Spawn()
m_iMinPitch = -60; m_iMinPitch = -60;
UTIL_SetSize(pev, Vector(-16, -16, -m_iRetractHeight), Vector(16, 16, m_iRetractHeight)); UTIL_SetSize(pev, Vector(-16, -16, -m_iRetractHeight), Vector(16, 16, m_iRetractHeight));
SetTouch(SentryTouch); SetTouch(&CSentry::SentryTouch);
SetThink(Initialize); SetThink(&CBaseTurret::Initialize);
pev->nextthink = gpGlobals->time + 0.3; pev->nextthink = gpGlobals->time + 0.3;
} }
@ -1217,7 +1217,7 @@ int CSentry::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float f
if (!m_iOn) if (!m_iOn)
{ {
SetThink( Deploy ); SetThink( &CBaseTurret::Deploy );
SetUse( NULL ); SetUse( NULL );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -1232,7 +1232,7 @@ int CSentry::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float f
ClearBits (pev->flags, FL_MONSTER); // why are they set in the first place??? ClearBits (pev->flags, FL_MONSTER); // why are they set in the first place???
SetUse(NULL); SetUse(NULL);
SetThink(SentryDeath); SetThink(&CSentry::SentryDeath);
SUB_UseTargets( this, USE_ON, 0 ); // wake up others SUB_UseTargets( this, USE_ON, 0 ); // wake up others
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;

View file

@ -433,8 +433,8 @@ void CBasePlayerItem :: FallInit( void )
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0) );//pointsize until it lands on the ground. UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0) );//pointsize until it lands on the ground.
SetTouch( DefaultTouch ); SetTouch( &CBasePlayerItem::DefaultTouch );
SetThink( FallThink ); SetThink( &CBasePlayerItem::FallThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -483,7 +483,7 @@ void CBasePlayerItem::Materialize( void )
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
UTIL_SetOrigin( pev, pev->origin );// link into world. UTIL_SetOrigin( pev, pev->origin );// link into world.
SetTouch (DefaultTouch); SetTouch (&CBasePlayerItem::DefaultTouch);
SetThink (NULL); SetThink (NULL);
} }
@ -536,7 +536,7 @@ CBaseEntity* CBasePlayerItem::Respawn( void )
{ {
pNewWeapon->pev->effects |= EF_NODRAW;// invisible for now pNewWeapon->pev->effects |= EF_NODRAW;// invisible for now
pNewWeapon->SetTouch( NULL );// no touch pNewWeapon->SetTouch( NULL );// no touch
pNewWeapon->SetThink( AttemptToMaterialize ); pNewWeapon->SetThink( &CBasePlayerItem::AttemptToMaterialize );
DROP_TO_FLOOR ( ENT(pev) ); DROP_TO_FLOOR ( ENT(pev) );
@ -675,14 +675,14 @@ int CBasePlayerItem::AddToPlayer( CBasePlayer *pPlayer )
void CBasePlayerItem::Drop( void ) void CBasePlayerItem::Drop( void )
{ {
SetTouch( NULL ); SetTouch( NULL );
SetThink(SUB_Remove); SetThink(&CBaseEntity::SUB_Remove);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
void CBasePlayerItem::Kill( void ) void CBasePlayerItem::Kill( void )
{ {
SetTouch( NULL ); SetTouch( NULL );
SetThink(SUB_Remove); SetThink(&CBaseEntity::SUB_Remove);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
@ -977,7 +977,7 @@ void CBasePlayerAmmo::Spawn( void )
UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16)); UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16));
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
SetTouch( DefaultTouch ); SetTouch( &CBasePlayerAmmo::DefaultTouch );
} }
CBaseEntity* CBasePlayerAmmo::Respawn( void ) CBaseEntity* CBasePlayerAmmo::Respawn( void )
@ -987,7 +987,7 @@ CBaseEntity* CBasePlayerAmmo::Respawn( void )
UTIL_SetOrigin( pev, g_pGameRules->VecAmmoRespawnSpot( this ) );// move to wherever I'm supposed to repawn. UTIL_SetOrigin( pev, g_pGameRules->VecAmmoRespawnSpot( this ) );// move to wherever I'm supposed to repawn.
SetThink( Materialize ); SetThink( &CBasePlayerAmmo::Materialize );
pev->nextthink = g_pGameRules->FlAmmoRespawnTime( this ); pev->nextthink = g_pGameRules->FlAmmoRespawnTime( this );
return this; return this;
@ -1002,7 +1002,7 @@ void CBasePlayerAmmo::Materialize( void )
pev->effects |= EF_MUZZLEFLASH; pev->effects |= EF_MUZZLEFLASH;
} }
SetTouch( DefaultTouch ); SetTouch( &CBasePlayerAmmo::DefaultTouch );
} }
void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther ) void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther )
@ -1021,7 +1021,7 @@ void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther )
else else
{ {
SetTouch( NULL ); SetTouch( NULL );
SetThink(SUB_Remove); SetThink(&CBaseEntity::SUB_Remove);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
} }
@ -1029,7 +1029,7 @@ void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther )
{ {
// evil impulse 101 hack, kill always // evil impulse 101 hack, kill always
SetTouch( NULL ); SetTouch( NULL );
SetThink(SUB_Remove); SetThink(&CBaseEntity::SUB_Remove);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
} }
@ -1173,7 +1173,7 @@ void CWeaponBox::Kill( void )
while ( pWeapon ) while ( pWeapon )
{ {
pWeapon->SetThink(SUB_Remove); pWeapon->SetThink(&CBaseEntity::SUB_Remove);
pWeapon->pev->nextthink = gpGlobals->time + 0.1; pWeapon->pev->nextthink = gpGlobals->time + 0.1;
pWeapon = pWeapon->m_pNext; pWeapon = pWeapon->m_pNext;
} }

View file

@ -128,15 +128,15 @@ void CDecal :: Spawn( void )
if ( FStringNull ( pev->targetname ) ) if ( FStringNull ( pev->targetname ) )
{ {
SetThink( StaticDecal ); SetThink( &CDecal::StaticDecal );
// if there's no targetname, the decal will spray itself on as soon as the world is done spawning. // if there's no targetname, the decal will spray itself on as soon as the world is done spawning.
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
else else
{ {
// if there IS a targetname, the decal sprays itself on when it is triggered. // if there IS a targetname, the decal sprays itself on when it is triggered.
SetThink ( SUB_DoNothing ); SetThink ( &CBaseEntity::SUB_DoNothing );
SetUse(TriggerDecal); SetUse(&CDecal::TriggerDecal);
} }
} }
@ -161,7 +161,7 @@ void CDecal :: TriggerDecal ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE
WRITE_SHORT( (int)VARS(trace.pHit)->modelindex ); WRITE_SHORT( (int)VARS(trace.pHit)->modelindex );
MESSAGE_END(); MESSAGE_END();
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -647,7 +647,7 @@ void CWorld :: Precache( void )
CBaseEntity *pEntity = CBaseEntity::Create( "env_message", g_vecZero, g_vecZero, NULL ); CBaseEntity *pEntity = CBaseEntity::Create( "env_message", g_vecZero, g_vecZero, NULL );
if ( pEntity ) if ( pEntity )
{ {
pEntity->SetThink( SUB_CallUseToggle ); pEntity->SetThink( &CBaseEntity::SUB_CallUseToggle );
pEntity->pev->message = pev->netname; pEntity->pev->message = pev->netname;
pev->netname = 0; pev->netname = 0;
pEntity->pev->nextthink = gpGlobals->time + 0.3; pEntity->pev->nextthink = gpGlobals->time + 0.3;

View file

@ -55,7 +55,7 @@ public:
if( pEnt != NULL && pEnt->IsPlayer() ) if( pEnt != NULL && pEnt->IsPlayer() )
{ {
if( flDamage > 20 && m_pfnThink == ExpThink ) if( flDamage > 20 && m_pfnThink == &CThrownFrag::ExpThink )
{ {
SetThink( NULL ); SetThink( NULL );
ExpDetonate(); ExpDetonate();
@ -175,7 +175,7 @@ void CMolotov::MolotovTouch(CBaseEntity *pOther)
::RadiusDamage(pev->origin,pev,m_pPlayer->pev,110,MOLOTOV_RADIUS*1.25f,CLASS_NONE,DMG_BURN); ::RadiusDamage(pev->origin,pev,m_pPlayer->pev,110,MOLOTOV_RADIUS*1.25f,CLASS_NONE,DMG_BURN);
// Radius Damage // Radius Damage
SetThink(DamageThink); SetThink(&CMolotov::DamageThink);
pev->nextthink = gpGlobals->time + 0.25f; pev->nextthink = gpGlobals->time + 0.25f;
PLAYBACK_EVENT_FULL(FEV_GLOBAL, PLAYBACK_EVENT_FULL(FEV_GLOBAL,
@ -250,11 +250,11 @@ CMolotov *CMolotov::ShootMolotov(unsigned int usFireEvent,CBasePlayer *pPlayer,V
pRetMolotov->pev->avelocity.x = RANDOM_FLOAT(-100,-500); pRetMolotov->pev->avelocity.x = RANDOM_FLOAT(-100,-500);
// Explode on contact // Explode on contact
pRetMolotov->SetTouch(MolotovTouch); pRetMolotov->SetTouch(&CMolotov::MolotovTouch);
pRetMolotov->pev->dmg = 50; pRetMolotov->pev->dmg = 50;
// Smoke for us // Smoke for us
pRetMolotov->SetThink(SmokeThink); pRetMolotov->SetThink(&CMolotov::SmokeThink);
pRetMolotov->pev->nextthink = gpGlobals->time + MOLOTOV_SMOKETIME; pRetMolotov->pev->nextthink = gpGlobals->time + MOLOTOV_SMOKETIME;
SET_MODEL(ENT(pRetMolotov->pev),"models/w_molotov.mdl"); SET_MODEL(ENT(pRetMolotov->pev),"models/w_molotov.mdl");
@ -416,7 +416,7 @@ void CMolotovCocktail::Holster(int skiplocal)
{ {
// Remove this item // Remove this item
m_pPlayer->pev->weapons &= ~(1<<WEAPON_MOLOTOVCOCKTAIL); m_pPlayer->pev->weapons &= ~(1<<WEAPON_MOLOTOVCOCKTAIL);
SetThink(DestroyItem); SetThink(&CBasePlayerItem::DestroyItem);
pev->nextthink = gpGlobals->time + 0.1f; pev->nextthink = gpGlobals->time + 0.1f;
} }
@ -592,7 +592,7 @@ void CTimedExplosiveWeapon::Holster( int skiplocal )
{ {
// Remove this item // Remove this item
m_pPlayer->pev->weapons &= ~(1<<m_iId); m_pPlayer->pev->weapons &= ~(1<<m_iId);
SetThink(DestroyItem); SetThink(&CBasePlayerItem::DestroyItem);
pev->nextthink = gpGlobals->time + 0.1f; pev->nextthink = gpGlobals->time + 0.1f;
} }
@ -851,8 +851,8 @@ CThrownFrag *CThrownFrag::ThrowExplosive(CThrownFrag *PtrFrag, unsigned int usEv
pRetExplosive->pev->angles = UTIL_VecToAngles(pRetExplosive->pev->velocity); pRetExplosive->pev->angles = UTIL_VecToAngles(pRetExplosive->pev->velocity);
pRetExplosive->pev->owner = ENT(pevOwner); pRetExplosive->pev->owner = ENT(pevOwner);
pRetExplosive->SetTouch(BounceTouch); // Bounce if touched pRetExplosive->SetTouch(&CThrownFrag::BounceTouch); // Bounce if touched
pRetExplosive->SetUse(ExpUse); pRetExplosive->SetUse(&CThrownFrag::ExpUse);
// Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate // Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate
// will insert a DANGER sound into the world sound list and delay detonation for one second so that // will insert a DANGER sound into the world sound list and delay detonation for one second so that
@ -860,7 +860,7 @@ CThrownFrag *CThrownFrag::ThrowExplosive(CThrownFrag *PtrFrag, unsigned int usEv
pRetExplosive->pev->dmgtime = gpGlobals->time + time; pRetExplosive->pev->dmgtime = gpGlobals->time + time;
pRetExplosive->SetThink(ExpThink); pRetExplosive->SetThink(&CThrownFrag::ExpThink);
pRetExplosive->pev->nextthink = gpGlobals->time + 0.1; pRetExplosive->pev->nextthink = gpGlobals->time + 0.1;
if(time < 0.1) if(time < 0.1)
@ -897,7 +897,7 @@ void CThrownFrag::ExpThink()
if (pev->dmgtime <= gpGlobals->time) if (pev->dmgtime <= gpGlobals->time)
{ {
SetThink( ExpDetonate ); SetThink( &CThrownFrag::ExpDetonate );
} }
if (pev->waterlevel != 0) if (pev->waterlevel != 0)
{ {
@ -941,7 +941,7 @@ void CThrownFrag::ExpDetonate()
RadiusDamage ( pev, pevOwner, pev->dmg, CLASS_NONE, DMG_BLAST ); RadiusDamage ( pev, pevOwner, pev->dmg, CLASS_NONE, DMG_BLAST );
pev->effects |= EF_NODRAW; pev->effects |= EF_NODRAW;
SetThink( SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
pev->velocity = g_vecZero; pev->velocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.3; pev->nextthink = gpGlobals->time + 0.3;

View file

@ -267,7 +267,7 @@ void CThrowingWeapon::Holster( int skiplocal )
{ {
// Remove this item // Remove this item
m_pPlayer->pev->weapons &= ~(1<<m_iId); m_pPlayer->pev->weapons &= ~(1<<m_iId);
SetThink(DestroyItem); SetThink(&CBasePlayerItem::DestroyItem);
pev->nextthink = gpGlobals->time + 0.1f; pev->nextthink = gpGlobals->time + 0.1f;
} }
} }
@ -1193,7 +1193,7 @@ CThrownMelee *CThrownMelee::ThrowObject(CBasePlayer *pPlayer,Vector vecOrigin,Ve
// Tumble - OMG IM GETTING DIZZY // Tumble - OMG IM GETTING DIZZY
pRetObject->pev->avelocity.x = RANDOM_FLOAT(-1800,-2000); pRetObject->pev->avelocity.x = RANDOM_FLOAT(-1800,-2000);
pRetObject->SetTouch(ThrownTouch); pRetObject->SetTouch(&CThrownMelee::ThrownTouch);
pRetObject->pev->dmg = flDmg; pRetObject->pev->dmg = flDmg;
SET_MODEL(ENT(pRetObject->pev),pszModel); SET_MODEL(ENT(pRetObject->pev),pszModel);
@ -1211,7 +1211,7 @@ void CThrownMelee::ThrownTouch(CBaseEntity *pOther)
if(FClassnameIs(pOther->pev,STRING(pev->classname))) if(FClassnameIs(pOther->pev,STRING(pev->classname)))
{ {
SetTouch(NULL); SetTouch(NULL);
SetThink(ThrownThink); SetThink(&CThrownMelee::ThrownThink);
pev->gravity = 1.0f; pev->gravity = 1.0f;
pev->avelocity.x = 0.0f; pev->avelocity.x = 0.0f;
@ -1258,7 +1258,7 @@ void CThrownMelee::ThrownTouch(CBaseEntity *pOther)
else else
{ {
SetTouch(NULL); SetTouch(NULL);
SetThink(ThrownThink); SetThink(&CThrownMelee::ThrownThink);
pev->gravity = 1.0f; pev->gravity = 1.0f;
pev->nextthink = gpGlobals->time + 0.15f; pev->nextthink = gpGlobals->time + 0.15f;