Browse Source

Add sed script and convert all SetXXX macros

foolsday
mittorn 9 years ago
parent
commit
81207e3815
  1. 4
      .gitigonre
  2. 2
      dlls/AI_BaseNPC_Schedule.cpp
  3. 18
      dlls/aflock.cpp
  4. 4
      dlls/airtank.cpp
  5. 26
      dlls/apache.cpp
  6. 6
      dlls/barnacle.cpp
  7. 4
      dlls/barney.cpp
  8. 2
      dlls/bigmomma.cpp
  9. 36
      dlls/bmodels.cpp
  10. 4
      dlls/bullsquid.cpp
  11. 70
      dlls/buttons.cpp
  12. 10
      dlls/cbase.h
  13. 20
      dlls/combat.cpp
  14. 14
      dlls/controller.cpp
  15. 12
      dlls/crossbow.cpp
  16. 4
      dlls/crowbar.cpp
  17. 26
      dlls/doors.cpp
  18. 58
      dlls/effects.cpp
  19. 4
      dlls/effects.h
  20. 2
      dlls/explode.cpp
  21. 14
      dlls/func_break.cpp
  22. 8
      dlls/gargantua.cpp
  23. 22
      dlls/ggrenade.cpp
  24. 8
      dlls/h_battery.cpp
  25. 10
      dlls/h_cine.cpp
  26. 2
      dlls/h_cycler.cpp
  27. 2
      dlls/handgrenade.cpp
  28. 6
      dlls/headcrab.cpp
  29. 8
      dlls/healthkit.cpp
  30. 4
      dlls/hgrunt.cpp
  31. 18
      dlls/hornet.cpp
  32. 2
      dlls/hornetgun.cpp
  33. 4
      dlls/ichthyosaur.cpp
  34. 10
      dlls/items.cpp
  35. 10
      dlls/leech.cpp
  36. 18
      dlls/monstermaker.cpp
  37. 10
      dlls/monsters.cpp
  38. 6
      dlls/mortar.cpp
  39. 4
      dlls/mpstubb.cpp
  40. 38
      dlls/nihilanth.cpp
  41. 12
      dlls/nodes.cpp
  42. 20
      dlls/osprey.cpp
  43. 2
      dlls/pathcorner.cpp
  44. 62
      dlls/plats.cpp
  45. 16
      dlls/player.cpp
  46. 24
      dlls/prop.cpp
  47. 5
      dlls/replace.sh
  48. 12
      dlls/rpg.cpp
  49. 8
      dlls/satchel.cpp
  50. 2
      dlls/schedule.cpp
  51. 6
      dlls/scientist.cpp
  52. 28
      dlls/scripted.cpp
  53. 12
      dlls/sound.cpp
  54. 12
      dlls/squeakgrenade.cpp
  55. 6
      dlls/subs.cpp
  56. 2
      dlls/talkmonster.cpp
  57. 14
      dlls/tentacle.cpp
  58. 66
      dlls/triggers.cpp
  59. 16
      dlls/tripmine.cpp
  60. 58
      dlls/turret.cpp
  61. 48
      dlls/weapons.cpp
  62. 10
      dlls/world.cpp

4
.gitigonre

@ -1,6 +1,8 @@
# Binaries # Binaries
*.o *.o
*.so *.so
*/*.o
*/*/*.o
*.a *.a
*.framework *.framework
*.exe

2
dlls/AI_BaseNPC_Schedule.cpp

@ -454,7 +454,7 @@ void CBaseMonster :: RunTask ( Task_t *pTask )
{ {
pev->deadflag = DEAD_DEAD; pev->deadflag = DEAD_DEAD;
ResetThink(); SetThink( NULL );
StopAnimation(); StopAnimation();
if ( !BBoxFlat() ) if ( !BBoxFlat() )

18
dlls/aflock.cpp

@ -211,7 +211,7 @@ void CFlockingFlyerFlock :: SpawnFlock( void )
pBoid->pev->frame = 0; pBoid->pev->frame = 0;
pBoid->pev->nextthink = gpGlobals->time + 0.2; pBoid->pev->nextthink = gpGlobals->time + 0.2;
pBoid->SetThink( CFlockingFlyer :: IdleThink ); pBoid->SetThink( &CFlockingFlyer :: IdleThink );
if ( pBoid != pLeader ) if ( pBoid != pLeader )
{ {
@ -229,7 +229,7 @@ void CFlockingFlyer :: Spawn( )
pev->frame = 0; pev->frame = 0;
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetThink( IdleThink ); SetThink( &IdleThink );
} }
//========================================================= //=========================================================
@ -292,7 +292,7 @@ void CFlockingFlyer :: Killed( entvars_t *pevAttacker, int iGib )
UTIL_SetSize( pev, Vector(0,0,0), Vector(0,0,0) ); UTIL_SetSize( pev, Vector(0,0,0), Vector(0,0,0) );
pev->movetype = MOVETYPE_TOSS; pev->movetype = MOVETYPE_TOSS;
SetThink ( FallHack ); SetThink( &FallHack );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -308,7 +308,7 @@ void CFlockingFlyer :: FallHack( void )
else else
{ {
pev->velocity = g_vecZero; pev->velocity = g_vecZero;
ResetThink(); SetThink( NULL );
} }
} }
} }
@ -366,7 +366,7 @@ void CFlockingFlyer :: IdleThink( void )
// see if there's a client in the same pvs as the monster // see if there's a client in the same pvs as the monster
if ( !FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) ) if ( !FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) )
{ {
SetThink( Start ); SetThink( &Start );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
} }
@ -380,11 +380,11 @@ void CFlockingFlyer :: Start( void )
if ( IsLeader() ) if ( IsLeader() )
{ {
SetThink( FlockLeaderThink ); SetThink( &FlockLeaderThink );
} }
else else
{ {
SetThink( FlockFollowerThink ); SetThink( &FlockFollowerThink );
} }
/* /*
@ -438,7 +438,7 @@ void CFlockingFlyer :: FormFlock( void )
} }
} }
SetThink( IdleThink );// now that flock is formed, go to idle and wait for a player to come along. SetThink( &IdleThink );// now that flock is formed, go to idle and wait for a player to come along.
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -673,7 +673,7 @@ void CFlockingFlyer :: FlockFollowerThink( void )
if ( IsLeader() || !InSquad() ) if ( IsLeader() || !InSquad() )
{ {
// the leader has been killed and this flyer suddenly finds himself the leader. // the leader has been killed and this flyer suddenly finds himself the leader.
SetThink ( FlockLeaderThink ); SetThink( &FlockLeaderThink );
return; return;
} }

4
dlls/airtank.cpp

@ -58,8 +58,8 @@ void CAirtank :: Spawn( void )
UTIL_SetSize(pev, Vector( -16, -16, 0), Vector(16, 16, 36)); UTIL_SetSize(pev, Vector( -16, -16, 0), Vector(16, 16, 36));
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
SetTouch( TankTouch ); SetTouch( &TankTouch );
SetThink( TankThink ); SetThink( &TankThink );
pev->flags |= FL_MONSTER; pev->flags |= FL_MONSTER;
pev->takedamage = DAMAGE_YES; pev->takedamage = DAMAGE_YES;

26
dlls/apache.cpp

@ -139,12 +139,12 @@ void CApache :: Spawn( void )
if (pev->spawnflags & SF_WAITFORTRIGGER) if (pev->spawnflags & SF_WAITFORTRIGGER)
{ {
SetUse( StartupUse ); SetUse( &StartupUse );
} }
else else
{ {
SetThink( HuntThink ); SetThink( &HuntThink );
SetTouch( FlyTouch ); SetTouch( &FlyTouch );
pev->nextthink = gpGlobals->time + 1.0; pev->nextthink = gpGlobals->time + 1.0;
} }
@ -186,10 +186,10 @@ void CApache::NullThink( void )
void CApache::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void CApache::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
SetThink( HuntThink ); SetThink( &HuntThink );
SetTouch( FlyTouch ); SetTouch( &FlyTouch );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
ResetUse(); SetUse( NULL );
} }
void CApache :: Killed( entvars_t *pevAttacker, int iGib ) void CApache :: Killed( entvars_t *pevAttacker, int iGib )
@ -200,8 +200,8 @@ void CApache :: Killed( entvars_t *pevAttacker, int iGib )
STOP_SOUND( ENT(pev), CHAN_STATIC, "apache/ap_rotor2.wav" ); STOP_SOUND( ENT(pev), CHAN_STATIC, "apache/ap_rotor2.wav" );
UTIL_SetSize( pev, Vector( -32, -32, -64), Vector( 32, 32, 0) ); UTIL_SetSize( pev, Vector( -32, -32, -64), Vector( 32, 32, 0) );
SetThink( DyingThink ); SetThink( &DyingThink );
SetTouch( CrashTouch ); SetTouch( &CrashTouch );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
pev->health = 0; pev->health = 0;
pev->takedamage = DAMAGE_NO; pev->takedamage = DAMAGE_NO;
@ -402,7 +402,7 @@ void CApache :: DyingThink( void )
WRITE_BYTE( BREAK_METAL ); WRITE_BYTE( BREAK_METAL );
MESSAGE_END(); MESSAGE_END();
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
} }
@ -426,7 +426,7 @@ void CApache::CrashTouch( CBaseEntity *pOther )
// only crash if we hit something solid // only crash if we hit something solid
if ( pOther->pev->solid == SOLID_BSP) if ( pOther->pev->solid == SOLID_BSP)
{ {
ResetTouch(); SetTouch( NULL );
m_flNextRocket = gpGlobals->time; m_flNextRocket = gpGlobals->time;
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -972,8 +972,8 @@ void CApacheHVR :: Spawn( void )
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0)); UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
SetThink( IgniteThink ); SetThink( &IgniteThink );
SetTouch( ExplodeTouch ); SetTouch( &ExplodeTouch );
UTIL_MakeAimVectors( pev->angles ); UTIL_MakeAimVectors( pev->angles );
m_vecForward = gpGlobals->v_forward; m_vecForward = gpGlobals->v_forward;
@ -1019,7 +1019,7 @@ void CApacheHVR :: IgniteThink( void )
MESSAGE_END(); // move PHS/PVS data sending into here (SEND_ALL, SEND_PVS, SEND_PHS) MESSAGE_END(); // move PHS/PVS data sending into here (SEND_ALL, SEND_PVS, SEND_PHS)
// set to accelerate // set to accelerate
SetThink( AccelerateThink ); SetThink( &AccelerateThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }

6
dlls/barnacle.cpp

@ -137,7 +137,7 @@ void CBarnacle :: Spawn()
SetActivity ( ACT_IDLE ); SetActivity ( ACT_IDLE );
SetThink ( BarnacleThink ); SetThink( &BarnacleThink );
pev->nextthink = gpGlobals->time + 0.5; pev->nextthink = gpGlobals->time + 0.5;
UTIL_SetOrigin ( pev, pev->origin ); UTIL_SetOrigin ( pev, pev->origin );
@ -370,7 +370,7 @@ void CBarnacle :: Killed( entvars_t *pevAttacker, int iGib )
StudioFrameAdvance( 0.1 ); StudioFrameAdvance( 0.1 );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetThink ( WaitTillDead ); SetThink( &WaitTillDead );
} }
//========================================================= //=========================================================
@ -386,7 +386,7 @@ void CBarnacle :: WaitTillDead ( void )
{ {
// death anim finished. // death anim finished.
StopAnimation(); StopAnimation();
ResetThink(); SetThink( NULL );
} }
} }

4
dlls/barney.cpp

@ -424,7 +424,7 @@ void CBarney :: Spawn()
m_afCapability = bits_CAP_HEAR | bits_CAP_TURN_HEAD | bits_CAP_DOORS_GROUP; m_afCapability = bits_CAP_HEAR | bits_CAP_TURN_HEAD | bits_CAP_DOORS_GROUP;
MonsterInit(); MonsterInit();
SetUse( FollowerUse ); SetUse( &FollowerUse );
} }
//========================================================= //=========================================================
@ -623,7 +623,7 @@ void CBarney::Killed( entvars_t *pevAttacker, int iGib )
CBaseEntity *pGun = DropItem( "weapon_9mmhandgun", vecGunPos, vecGunAngles ); CBaseEntity *pGun = DropItem( "weapon_9mmhandgun", vecGunPos, vecGunAngles );
} }
ResetUse(); SetUse( NULL );
CTalkMonster::Killed( pevAttacker, iGib ); CTalkMonster::Killed( pevAttacker, iGib );
} }

2
dlls/bigmomma.cpp

@ -1198,7 +1198,7 @@ CBMortar *CBMortar::Shoot( edict_t *pOwner, Vector vecStart, Vector vecVelocity
pSpit->pev->velocity = vecVelocity; pSpit->pev->velocity = vecVelocity;
pSpit->pev->owner = pOwner; pSpit->pev->owner = pOwner;
pSpit->pev->scale = 2.5; pSpit->pev->scale = 2.5;
pSpit->SetThink ( Animate ); pSpit->SetThink( &Animate );
pSpit->pev->nextthink = gpGlobals->time + 0.1; pSpit->pev->nextthink = gpGlobals->time + 0.1;
return pSpit; return pSpit;

36
dlls/bmodels.cpp

@ -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( &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( &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( &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( &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( &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( &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( &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( &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( &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( &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( &SUB_CallUseToggle );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
pev->speed = 0; pev->speed = 0;
SetUse( PendulumUse ); SetUse( &PendulumUse );
if ( FBitSet( pev->spawnflags, SF_PENDULUM_SWING ) ) if ( FBitSet( pev->spawnflags, SF_PENDULUM_SWING ) )
{ {
SetTouch ( RopeTouch ); SetTouch( &RopeTouch );
} }
} }
@ -837,12 +837,12 @@ 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( &Stop );
} }
else else
{ {
pev->speed = 0; // Dead stop pev->speed = 0; // Dead stop
ResetThink(); SetThink( NULL );
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
} }
} }
@ -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( &Swing );
m_dampSpeed = m_maxSpeed; m_dampSpeed = m_maxSpeed;
} }
} }
@ -860,7 +860,7 @@ void CPendulum :: Stop( void )
{ {
pev->angles = m_start; pev->angles = m_start;
pev->speed = 0; pev->speed = 0;
ResetThink(); SetThink( NULL );
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
} }
@ -901,7 +901,7 @@ void CPendulum :: Swing( void )
{ {
pev->angles = m_center; pev->angles = m_center;
pev->speed = 0; pev->speed = 0;
ResetThink(); SetThink( NULL );
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
} }
else if ( pev->speed > m_dampSpeed ) else if ( pev->speed > m_dampSpeed )

4
dlls/bullsquid.cpp

@ -121,7 +121,7 @@ void CSquidSpit::Shoot( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity
pSpit->pev->velocity = vecVelocity; pSpit->pev->velocity = vecVelocity;
pSpit->pev->owner = ENT(pevOwner); pSpit->pev->owner = ENT(pevOwner);
pSpit->SetThink ( Animate ); pSpit->SetThink( &Animate );
pSpit->pev->nextthink = gpGlobals->time + 0.1; pSpit->pev->nextthink = gpGlobals->time + 0.1;
} }
@ -172,7 +172,7 @@ void CSquidSpit :: Touch ( CBaseEntity *pOther )
pOther->TakeDamage ( pev, pev, gSkillData.bullsquidDmgSpit, DMG_GENERIC ); pOther->TakeDamage ( pev, pev, gSkillData.bullsquidDmgSpit, DMG_GENERIC );
} }
SetThink ( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }

70
dlls/buttons.cpp

@ -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( &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( &SUB_DoNothing);
// search for all entities which target this multisource (pev->targetname) // search for all entities which target this multisource (pev->targetname)
@ -398,7 +398,7 @@ int CBaseButton::TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, fl
if ( code == BUTTON_NOTHING ) if ( code == BUTTON_NOTHING )
return 0; return 0;
// Temporarily disable the touch function, until movement is finished. // Temporarily disable the touch function, until movement is finished.
ResetTouch(); SetTouch( NULL );
m_hActivator = CBaseEntity::Instance( pevAttacker ); m_hActivator = CBaseEntity::Instance( pevAttacker );
if ( m_hActivator == NULL ) if ( m_hActivator == NULL )
@ -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( &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( &ButtonTouch );
} }
else else
{ {
ResetTouch(); SetTouch( NULL );
SetUse ( ButtonUse ); SetUse( &ButtonUse );
} }
} }
@ -567,7 +567,7 @@ void DoSpark(entvars_t *pev, const Vector &location )
void CBaseButton::ButtonSpark ( void ) void CBaseButton::ButtonSpark ( void )
{ {
SetThink ( ButtonSpark ); SetThink( &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 );
@ -646,7 +646,7 @@ void CBaseButton:: ButtonTouch( CBaseEntity *pOther )
} }
// Temporarily disable the touch function, until movement is finished. // Temporarily disable the touch function, until movement is finished.
ResetTouch(); SetTouch( NULL );
if ( code == BUTTON_RETURN ) if ( code == BUTTON_RETURN )
{ {
@ -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( &TriggerAndWait );
if (!m_fRotating) if (!m_fRotating)
LinearMove( m_vecPosition2, pev->speed); LinearMove( m_vecPosition2, pev->speed);
else else
@ -706,15 +706,15 @@ void CBaseButton::TriggerAndWait( void )
if ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) ) // this button only works if USED, not touched! if ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) ) // this button only works if USED, not touched!
{ {
// ALL buttons are now use only // ALL buttons are now use only
ResetTouch(); SetTouch( NULL );
} }
else else
SetTouch( ButtonTouch ); SetTouch( &ButtonTouch );
} }
else else
{ {
pev->nextthink = pev->ltime + m_flWait; pev->nextthink = pev->ltime + m_flWait;
SetThink( ButtonReturn ); SetThink( &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( &ButtonBackHome );
if (!m_fRotating) if (!m_fRotating)
LinearMove( m_vecPosition1, pev->speed); LinearMove( m_vecPosition1, pev->speed);
else else
@ -781,15 +781,15 @@ void CBaseButton::ButtonBackHome( void )
if ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) ) // this button only works if USED, not touched! if ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) ) // this button only works if USED, not touched!
{ {
// All buttons are now use only // All buttons are now use only
ResetTouch(); SetTouch( NULL );
} }
else else
SetTouch( ButtonTouch ); SetTouch( &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( &ButtonSpark );
pev->nextthink = gpGlobals->time + 0.5;// no hurry. pev->nextthink = gpGlobals->time + 0.5;// no hurry.
} }
} }
@ -856,13 +856,13 @@ void CRotButton::Spawn( void )
// if the button is flagged for USE button activation only, take away it's touch function and add a use function // if the button is flagged for USE button activation only, take away it's touch function and add a use function
if ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) ) if ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) )
{ {
ResetTouch(); SetTouch( NULL );
SetUse ( ButtonUse ); SetUse( &ButtonUse );
} }
else // touchable button else // touchable button
SetTouch( ButtonTouch ); SetTouch( &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( &Off );
} }
void CMomentaryRotButton::UpdateTarget( float value ) void CMomentaryRotButton::UpdateTarget( float value )
@ -1077,12 +1077,12 @@ 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( &Return );
pev->nextthink = pev->ltime + 0.1; pev->nextthink = pev->ltime + 0.1;
m_direction = -1; m_direction = -1;
} }
else else
ResetThink(); SetThink( NULL );
} }
void CMomentaryRotButton::Return( void ) void CMomentaryRotButton::Return( void )
@ -1102,7 +1102,7 @@ void CMomentaryRotButton::UpdateSelfReturn( float value )
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
pev->angles = m_start; pev->angles = m_start;
pev->nextthink = -1; pev->nextthink = -1;
ResetThink(); SetThink( NULL );
} }
else else
{ {
@ -1147,21 +1147,21 @@ LINK_ENTITY_TO_CLASS(env_debris, CEnvSpark);
void CEnvSpark::Spawn(void) void CEnvSpark::Spawn(void)
{ {
ResetThink(); SetThink( NULL );
ResetUse(); SetUse( NULL );
if (FBitSet(pev->spawnflags, 32)) // Use for on/off if (FBitSet(pev->spawnflags, 32)) // Use for on/off
{ {
if (FBitSet(pev->spawnflags, 64)) // Start on if (FBitSet(pev->spawnflags, 64)) // Start on
{ {
SetThink(SparkThink); // start sparking SetThink( &SparkThink); // start sparking
SetUse(SparkStop); // set up +USE to stop sparking SetUse( &SparkStop); // set up +USE to stop sparking
} }
else else
SetUse(SparkStart); SetUse( &SparkStart);
} }
else else
SetThink(SparkThink); SetThink( &SparkThink);
pev->nextthink = gpGlobals->time + ( 0.1 + RANDOM_FLOAT ( 0, 1.5 ) ); pev->nextthink = gpGlobals->time + ( 0.1 + RANDOM_FLOAT ( 0, 1.5 ) );
@ -1208,15 +1208,15 @@ 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( &SparkStop);
SetThink(SparkThink); SetThink( &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( &SparkStart);
ResetThink(); SetThink( NULL );
} }
#define SF_BTARGET_USE 0x0001 #define SF_BTARGET_USE 0x0001

10
dlls/cbase.h

@ -373,10 +373,10 @@ public:
#else #else
#define SetThink( a ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (&a) #define SetThink( a ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (a)
#define SetTouch( a ) m_pfnTouch = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (&a) #define SetTouch( a ) m_pfnTouch = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (a)
#define SetUse( a ) m_pfnUse = static_cast <void (CBaseEntity::*)( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )> (&a) #define SetUse( a ) m_pfnUse = static_cast <void (CBaseEntity::*)( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )> (a)
#define SetBlocked( a ) m_pfnBlocked = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (&a) #define SetBlocked( a ) m_pfnBlocked = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (a)
#define ResetThink( ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (NULL) #define ResetThink( ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (NULL)
#define ResetTouch( ) m_pfnTouch = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (NULL) #define ResetTouch( ) m_pfnTouch = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (NULL)
#define ResetUse( ) m_pfnUse = static_cast <void (CBaseEntity::*)( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )> (NULL) #define ResetUse( ) m_pfnUse = static_cast <void (CBaseEntity::*)( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )> (NULL)
@ -557,7 +557,7 @@ public:
// the button will be allowed to operate. Otherwise, it will be // the button will be allowed to operate. Otherwise, it will be
// deactivated. // deactivated.
}; };
#define SetMoveDone( a ) m_pfnCallWhenMoveDone = static_cast <void (CBaseToggle::*)(void)> (&a) #define SetMoveDone( a ) m_pfnCallWhenMoveDone = static_cast <void (CBaseToggle::*)(void)> (a)

20
dlls/combat.cpp

@ -115,8 +115,8 @@ 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( &StickyGibTouch );
pGib->ResetThink(); pGib->SetThink( NULL );
} }
pGib->LimitVelocity(); pGib->LimitVelocity();
} }
@ -331,7 +331,7 @@ void CBaseMonster :: GibMonster( void )
if ( gibbed ) if ( gibbed )
{ {
// don't remove players! // don't remove players!
SetThink ( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
else else
@ -622,7 +622,7 @@ void CBaseMonster :: Killed( entvars_t *pevAttacker, int iGib )
} }
else if ( pev->flags & FL_MONSTER ) else if ( pev->flags & FL_MONSTER )
{ {
ResetTouch(); SetTouch( NULL );
BecomeDead(); BecomeDead();
} }
@ -654,7 +654,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( &SUB_FadeOut );
} }
void CBaseEntity :: SUB_FadeOut ( void ) void CBaseEntity :: SUB_FadeOut ( void )
@ -668,7 +668,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( &SUB_Remove );
} }
} }
@ -688,7 +688,7 @@ void CGib :: WaitTillLand ( void )
if ( pev->velocity == g_vecZero ) if ( pev->velocity == g_vecZero )
{ {
SetThink (SUB_StartFadeOut); SetThink( &SUB_StartFadeOut);
pev->nextthink = gpGlobals->time + m_lifeTime; pev->nextthink = gpGlobals->time + m_lifeTime;
// If you bleed, you stink! // If you bleed, you stink!
@ -756,7 +756,7 @@ void CGib :: StickyGibTouch ( CBaseEntity *pOther )
Vector vecSpot; Vector vecSpot;
TraceResult tr; TraceResult tr;
SetThink ( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 10; pev->nextthink = gpGlobals->time + 10;
if ( !FClassnameIs( pOther->pev, "worldspawn" ) ) if ( !FClassnameIs( pOther->pev, "worldspawn" ) )
@ -797,8 +797,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( &WaitTillLand );
SetTouch ( BounceGibTouch ); SetTouch( &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).

14
dlls/controller.cpp

@ -1170,8 +1170,8 @@ void CControllerHeadBall :: Spawn( void )
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0)); UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
SetThink( HuntThink ); SetThink( &HuntThink );
SetTouch( BounceTouch ); SetTouch( &BounceTouch );
m_vecIdeal = Vector( 0, 0, 0 ); m_vecIdeal = Vector( 0, 0, 0 );
@ -1213,7 +1213,7 @@ void CControllerHeadBall :: HuntThink( void )
// check world boundaries // check world boundaries
if (gpGlobals->time - pev->dmgtime > 5 || pev->renderamt < 64 || m_hEnemy == NULL || m_hOwner == NULL || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096) if (gpGlobals->time - pev->dmgtime > 5 || pev->renderamt < 64 || m_hEnemy == NULL || m_hOwner == NULL || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096)
{ {
ResetTouch(); SetTouch( NULL );
UTIL_Remove( this ); UTIL_Remove( this );
return; return;
} }
@ -1257,7 +1257,7 @@ void CControllerHeadBall :: HuntThink( void )
m_flNextAttack = gpGlobals->time + 3.0; m_flNextAttack = gpGlobals->time + 3.0;
SetThink( DieThink ); SetThink( &DieThink );
pev->nextthink = gpGlobals->time + 0.3; pev->nextthink = gpGlobals->time + 0.3;
} }
@ -1364,8 +1364,8 @@ void CControllerZapBall :: Spawn( void )
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0)); UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
SetThink( AnimateThink ); SetThink( &AnimateThink );
SetTouch( ExplodeTouch ); SetTouch( &ExplodeTouch );
m_hOwner = Instance( pev->owner ); m_hOwner = Instance( pev->owner );
pev->dmgtime = gpGlobals->time; // keep track of when ball spawned pev->dmgtime = gpGlobals->time; // keep track of when ball spawned
@ -1389,7 +1389,7 @@ void CControllerZapBall :: AnimateThink( void )
if (gpGlobals->time - pev->dmgtime > 5 || pev->velocity.Length() < 10) if (gpGlobals->time - pev->dmgtime > 5 || pev->velocity.Length() < 10)
{ {
ResetTouch(); SetTouch( NULL );
UTIL_Remove( this ); UTIL_Remove( this );
} }
} }

12
dlls/crossbow.cpp

@ -71,8 +71,8 @@ void CCrossbowBolt::Spawn( )
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0)); UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0));
SetTouch( BoltTouch ); SetTouch( &BoltTouch );
SetThink( BubbleThink ); SetThink( &BubbleThink );
pev->nextthink = gpGlobals->time + 0.2; pev->nextthink = gpGlobals->time + 0.2;
} }
@ -96,8 +96,8 @@ int CCrossbowBolt :: Classify ( void )
void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
{ {
ResetTouch(); SetTouch( NULL );
ResetThink(); SetThink( NULL );
if (pOther->pev->takedamage) if (pOther->pev->takedamage)
{ {
@ -139,7 +139,7 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
{ {
EMIT_SOUND_DYN(ENT(pev), CHAN_BODY, "weapons/xbow_hit1.wav", RANDOM_FLOAT(0.95, 1.0), ATTN_NORM, 0, 98 + RANDOM_LONG(0,7)); EMIT_SOUND_DYN(ENT(pev), CHAN_BODY, "weapons/xbow_hit1.wav", RANDOM_FLOAT(0.95, 1.0), ATTN_NORM, 0, 98 + RANDOM_LONG(0,7));
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time;// this will get changed below if the bolt is allowed to stick in what it hit. pev->nextthink = gpGlobals->time;// this will get changed below if the bolt is allowed to stick in what it hit.
if ( FClassnameIs( pOther->pev, "worldspawn" ) ) if ( FClassnameIs( pOther->pev, "worldspawn" ) )
@ -179,7 +179,7 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
if ( g_pGameRules->IsMultiplayer() ) if ( g_pGameRules->IsMultiplayer() )
{ {
SetThink( ExplodeThink ); SetThink( &ExplodeThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
} }

4
dlls/crowbar.cpp

@ -147,7 +147,7 @@ void CCrowbar::PrimaryAttack()
{ {
if (! Swing( 1 )) if (! Swing( 1 ))
{ {
SetThink( SwingAgain ); SetThink( &SwingAgain );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
} }
@ -306,7 +306,7 @@ int CCrowbar::Swing( int fFirst )
#endif #endif
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25;
SetThink( Smack ); SetThink( &Smack );
pev->nextthink = UTIL_WeaponTimeBase() + 0.2; pev->nextthink = UTIL_WeaponTimeBase() + 0.2;

26
dlls/doors.cpp

@ -317,10 +317,10 @@ void CBaseDoor::Spawn( )
// if the door is flagged for USE button activation only, use NULL touch function // if the door is flagged for USE button activation only, use NULL touch function
if ( FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) ) if ( FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) )
{ {
ResetTouch(); SetTouch( NULL );
} }
else // touchable button else // touchable button
SetTouch( DoorTouch ); SetTouch( &DoorTouch );
} }
@ -509,7 +509,7 @@ void CBaseDoor::DoorTouch( CBaseEntity *pOther )
m_hActivator = pOther;// remember who activated the door m_hActivator = pOther;// remember who activated the door
if (DoorActivate( )) if (DoorActivate( ))
ResetTouch(); // Temporarily disable the touch function, until movement is finished. SetTouch( NULL ); // Temporarily disable the touch function, until movement is finished.
} }
@ -576,7 +576,7 @@ void CBaseDoor::DoorGoUp( void )
m_toggle_state = TS_GOING_UP; m_toggle_state = TS_GOING_UP;
SetMoveDone( DoorHitTop ); SetMoveDone( &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;
@ -625,13 +625,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( &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( &DoorGoDown );
if ( m_flWait == -1 ) if ( m_flWait == -1 )
{ {
@ -661,7 +661,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( &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
@ -685,10 +685,10 @@ void CBaseDoor::DoorHitBottom( void )
// Re-instate touch method, cycle is complete // Re-instate touch method, cycle is complete
if ( FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) ) if ( FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) )
{// use only door {// use only door
ResetTouch(); SetTouch( NULL );
} }
else // touchable door else // touchable door
SetTouch( DoorTouch ); SetTouch( &DoorTouch );
SUB_UseTargets( m_hActivator, USE_TOGGLE, 0 ); // this isn't finished SUB_UseTargets( m_hActivator, USE_TOGGLE, 0 ); // this isn't finished
@ -862,10 +862,10 @@ void CRotDoor::Spawn( void )
if ( FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) ) if ( FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) )
{ {
ResetTouch(); SetTouch( NULL );
} }
else // touchable button else // touchable button
SetTouch( DoorTouch ); SetTouch( &DoorTouch );
} }
@ -935,7 +935,7 @@ void CMomentaryDoor::Spawn( void )
m_vecPosition2 = m_vecPosition1; m_vecPosition2 = m_vecPosition1;
m_vecPosition1 = pev->origin; m_vecPosition1 = pev->origin;
} }
ResetTouch(); SetTouch( NULL );
Precache(); Precache();
} }
@ -1075,7 +1075,7 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
EMIT_SOUND(ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseMoving), 1, ATTN_NORM); EMIT_SOUND(ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseMoving), 1, ATTN_NORM);
LinearMove( move, speed ); LinearMove( move, speed );
SetMoveDone( MomentaryMoveDone ); SetMoveDone( &MomentaryMoveDone );
} }
} }

58
dlls/effects.cpp

@ -87,7 +87,7 @@ void CBubbling::Spawn( void )
if ( !(pev->spawnflags & SF_BUBBLES_STARTOFF) ) if ( !(pev->spawnflags & SF_BUBBLES_STARTOFF) )
{ {
SetThink( FizzThink ); SetThink( &FizzThink );
pev->nextthink = gpGlobals->time + 2.0; pev->nextthink = gpGlobals->time + 2.0;
m_state = 1; m_state = 1;
} }
@ -108,12 +108,12 @@ void CBubbling::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
if ( m_state ) if ( m_state )
{ {
SetThink( FizzThink ); SetThink( &FizzThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
else else
{ {
ResetThink(); SetThink( NULL );
pev->nextthink = 0; pev->nextthink = 0;
} }
} }
@ -427,7 +427,7 @@ LINK_ENTITY_TO_CLASS( trip_beam, CTripBeam );
void CTripBeam::Spawn( void ) void CTripBeam::Spawn( void )
{ {
CLightning::Spawn(); CLightning::Spawn();
SetTouch( TriggerTouch ); SetTouch( &TriggerTouch );
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
RelinkBeam(); RelinkBeam();
} }
@ -459,7 +459,7 @@ void CLightning::Spawn( void )
{ {
if ( FStringNull( m_iszSpriteName ) ) if ( FStringNull( m_iszSpriteName ) )
{ {
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
return; return;
} }
pev->solid = SOLID_NOT; // Remove model & collisions pev->solid = SOLID_NOT; // Remove model & collisions
@ -469,10 +469,10 @@ void CLightning::Spawn( void )
if ( ServerSide() ) if ( ServerSide() )
{ {
ResetThink(); SetThink( NULL );
if ( pev->dmg > 0 ) if ( pev->dmg > 0 )
{ {
SetThink( DamageThink ); SetThink( &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( &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( &StrikeUse );
} }
if ( FStringNull(pev->targetname) || FBitSet(pev->spawnflags, SF_BEAM_STARTON) ) if ( FStringNull(pev->targetname) || FBitSet(pev->spawnflags, SF_BEAM_STARTON) )
{ {
SetThink( StrikeThink ); SetThink( &StrikeThink );
pev->nextthink = gpGlobals->time + 1.0; pev->nextthink = gpGlobals->time + 1.0;
} }
} }
@ -612,16 +612,16 @@ void CLightning::StrikeUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
if ( m_active ) if ( m_active )
{ {
m_active = 0; m_active = 0;
ResetThink(); SetThink( NULL );
} }
else else
{ {
SetThink( StrikeThink ); SetThink( &StrikeThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
if ( !FBitSet( pev->spawnflags, SF_BEAM_TOGGLE ) ) if ( !FBitSet( pev->spawnflags, SF_BEAM_TOGGLE ) )
ResetUse(); SetUse( NULL );
} }
@ -961,13 +961,13 @@ void CLaser::Spawn( void )
{ {
if ( FStringNull( pev->model ) ) if ( FStringNull( pev->model ) )
{ {
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
return; return;
} }
pev->solid = SOLID_NOT; // Remove model & collisions pev->solid = SOLID_NOT; // Remove model & collisions
Precache( ); Precache( );
SetThink( StrikeThink ); SetThink( &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( &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( &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( &ShootThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -1511,12 +1511,12 @@ void CGibShooter :: ShootThink ( void )
if ( pev->spawnflags & SF_GIBSHOOTER_REPEATABLE ) if ( pev->spawnflags & SF_GIBSHOOTER_REPEATABLE )
{ {
m_iGibs = m_iGibCapacity; m_iGibs = m_iGibCapacity;
ResetThink(); SetThink( NULL );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
else else
{ {
SetThink ( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
} }
@ -1701,14 +1701,14 @@ void CTestEffect::TestThink( void )
m_flStartTime = gpGlobals->time; m_flStartTime = gpGlobals->time;
m_iBeam = 0; m_iBeam = 0;
// pev->nextthink = gpGlobals->time; // pev->nextthink = gpGlobals->time;
ResetThink(); SetThink( NULL );
} }
} }
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( &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( &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( &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( &CanThink);
pev->nextthink = gpGlobals->time + 0.5; pev->nextthink = gpGlobals->time + 0.5;
} }
@ -2238,8 +2238,8 @@ 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 ) );
ResetThink(); SetThink( NULL );
SetTouch ( CanTouch ); SetTouch( &CanTouch );
} }
void CItemSoda::CanTouch ( CBaseEntity *pOther ) void CItemSoda::CanTouch ( CBaseEntity *pOther )
@ -2262,7 +2262,7 @@ void CItemSoda::CanTouch ( CBaseEntity *pOther )
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
pev->effects = EF_NODRAW; pev->effects = EF_NODRAW;
ResetTouch(); SetTouch( NULL );
SetThink ( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }

4
dlls/effects.h

@ -79,7 +79,7 @@ public:
inline void AnimateAndDie( float framerate ) inline void AnimateAndDie( float framerate )
{ {
SetThink(AnimateUntilDead); SetThink( &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( &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;

2
dlls/explode.cpp

@ -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( &Smoke );
pev->nextthink = gpGlobals->time + 0.3; pev->nextthink = gpGlobals->time + 0.3;
// draw sparks // draw sparks

14
dlls/func_break.cpp

@ -164,9 +164,9 @@ 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( &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
ResetTouch(); SetTouch( NULL );
// Flag unbreakable glass as "worldbrush" so it will block ALL tracelines // Flag unbreakable glass as "worldbrush" so it will block ALL tracelines
if ( !IsBreakable() && pev->rendermode != kRenderNormal ) if ( !IsBreakable() && pev->rendermode != kRenderNormal )
@ -445,7 +445,7 @@ void CBreakable::BreakTouch( CBaseEntity *pOther )
if (flDamage >= pev->health) if (flDamage >= pev->health)
{ {
ResetTouch(); SetTouch( NULL );
TakeDamage(pevToucher, pevToucher, flDamage, DMG_CRUSH); TakeDamage(pevToucher, pevToucher, flDamage, DMG_CRUSH);
// do a little damage to player if we broke glass or computer // do a little damage to player if we broke glass or computer
@ -459,8 +459,8 @@ void CBreakable::BreakTouch( CBaseEntity *pOther )
// play creaking sound here. // play creaking sound here.
DamageSound(); DamageSound();
SetThink ( Die ); SetThink( &Die );
ResetTouch(); SetTouch( NULL );
if ( m_flDelay == 0 ) if ( m_flDelay == 0 )
{// !!!BUGBUG - why doesn't zero delay work? {// !!!BUGBUG - why doesn't zero delay work?
@ -743,7 +743,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( &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() );
@ -977,7 +977,7 @@ void CPushable :: Move( CBaseEntity *pOther, int push )
{ {
m_lastSound = RANDOM_LONG(0,2); m_lastSound = RANDOM_LONG(0,2);
EMIT_SOUND(ENT(pev), CHAN_WEAPON, m_soundNames[m_lastSound], 0.5, ATTN_NORM); EMIT_SOUND(ENT(pev), CHAN_WEAPON, m_soundNames[m_lastSound], 0.5, ATTN_NORM);
// SetThink( StopSound ); // SetThink( &StopSound );
// pev->nextthink = pev->ltime + 0.1; // pev->nextthink = pev->ltime + 0.1;
} }
else else

8
dlls/gargantua.cpp

@ -161,7 +161,7 @@ void CStomp::Think( void )
pSprite->pev->velocity = Vector(RANDOM_FLOAT(-200,200),RANDOM_FLOAT(-200,200),175); pSprite->pev->velocity = Vector(RANDOM_FLOAT(-200,200),RANDOM_FLOAT(-200,200),175);
// pSprite->AnimateAndDie( RANDOM_FLOAT( 8.0, 12.0 ) ); // pSprite->AnimateAndDie( RANDOM_FLOAT( 8.0, 12.0 ) );
pSprite->pev->nextthink = gpGlobals->time + 0.3; pSprite->pev->nextthink = gpGlobals->time + 0.3;
pSprite->SetThink( SUB_Remove ); pSprite->SetThink( &SUB_Remove );
pSprite->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxFadeFast ); pSprite->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxFadeFast );
} }
} }
@ -1126,7 +1126,7 @@ void CGargantua::RunTask( Task_t *pTask )
pev->rendercolor.z = 0; pev->rendercolor.z = 0;
StopAnimation(); StopAnimation();
pev->nextthink = gpGlobals->time + 0.15; pev->nextthink = gpGlobals->time + 0.15;
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
int i; int i;
int parts = MODEL_FRAMES( gGargGibModel ); int parts = MODEL_FRAMES( gGargGibModel );
for ( i = 0; i < 10; i++ ) for ( i = 0; i < 10; i++ )
@ -1145,7 +1145,7 @@ void CGargantua::RunTask( Task_t *pTask )
pGib->pev->origin = pev->origin; pGib->pev->origin = pev->origin;
pGib->pev->velocity = UTIL_RandomBloodVector() * RANDOM_FLOAT( 300, 500 ); pGib->pev->velocity = UTIL_RandomBloodVector() * RANDOM_FLOAT( 300, 500 );
pGib->pev->nextthink = gpGlobals->time + 1.25; pGib->pev->nextthink = gpGlobals->time + 1.25;
pGib->SetThink( SUB_FadeOut ); pGib->SetThink( &SUB_FadeOut );
} }
MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin );
WRITE_BYTE( TE_BREAKMODEL); WRITE_BYTE( TE_BREAKMODEL);
@ -1359,7 +1359,7 @@ void SpawnExplosion( Vector center, float randomRange, float time, int magnitude
pExplosion->pev->spawnflags |= SF_ENVEXPLOSION_NODAMAGE; pExplosion->pev->spawnflags |= SF_ENVEXPLOSION_NODAMAGE;
pExplosion->Spawn(); pExplosion->Spawn();
pExplosion->SetThink( CBaseEntity::SUB_CallUseToggle ); pExplosion->SetThink( &CBaseEntity::SUB_CallUseToggle );
pExplosion->pev->nextthink = gpGlobals->time + time; pExplosion->pev->nextthink = gpGlobals->time + time;
} }

22
dlls/ggrenade.cpp

@ -113,7 +113,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType )
} }
pev->effects |= EF_NODRAW; pev->effects |= EF_NODRAW;
SetThink( Smoke ); SetThink( &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( &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( &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( &Detonate );
} }
if (pev->waterlevel != 0) if (pev->waterlevel != 0)
{ {
@ -368,14 +368,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( &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( &ExplodeTouch );
pGrenade->pev->dmg = gSkillData.plrDmgM203Grenade; pGrenade->pev->dmg = gSkillData.plrDmgM203Grenade;
@ -392,14 +392,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( &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( &TumbleThink );
pGrenade->pev->nextthink = gpGlobals->time + 0.1; pGrenade->pev->nextthink = gpGlobals->time + 0.1;
if (time < 0.1) if (time < 0.1)
{ {
@ -442,9 +442,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( &SUB_DoNothing );
pGrenade->SetUse( DetonateUse ); pGrenade->SetUse( &DetonateUse );
pGrenade->SetTouch( SlideTouch ); pGrenade->SetTouch( &SlideTouch );
pGrenade->pev->spawnflags = SF_DETONATE; pGrenade->pev->spawnflags = SF_DETONATE;
pGrenade->pev->friction = 0.9; pGrenade->pev->friction = 0.9;

8
dlls/h_battery.cpp

@ -129,7 +129,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
} }
pev->nextthink = pev->ltime + 0.25; pev->nextthink = pev->ltime + 0.25;
SetThink(Off); SetThink( &Off);
// Time to recharge yet? // Time to recharge yet?
@ -179,7 +179,7 @@ void CRecharge::Recharge(void)
{ {
m_iJuice = gSkillData.suitchargerCapacity; m_iJuice = gSkillData.suitchargerCapacity;
pev->frame = 0; pev->frame = 0;
SetThink( SUB_DoNothing ); SetThink( &SUB_DoNothing );
} }
void CRecharge::Off(void) void CRecharge::Off(void)
@ -193,8 +193,8 @@ void CRecharge::Off(void)
if ((!m_iJuice) && ( ( m_iReactivate = g_pGameRules->FlHEVChargerRechargeTime() ) > 0) ) if ((!m_iJuice) && ( ( m_iReactivate = g_pGameRules->FlHEVChargerRechargeTime() ) > 0) )
{ {
pev->nextthink = pev->ltime + m_iReactivate; pev->nextthink = pev->ltime + m_iReactivate;
SetThink(Recharge); SetThink( &Recharge);
} }
else else
SetThink( SUB_DoNothing ); SetThink( &SUB_DoNothing );
} }

10
dlls/h_cine.cpp

@ -124,7 +124,7 @@ void CLegacyCineMonster :: CineSpawn( char *szModel )
// if no targetname, start now // if no targetname, start now
if ( FStringNull(pev->targetname) ) if ( FStringNull(pev->targetname) )
{ {
SetThink( CineThink ); SetThink( &CineThink );
pev->nextthink += 1.0; pev->nextthink += 1.0;
} }
} }
@ -136,7 +136,7 @@ void CLegacyCineMonster :: CineSpawn( char *szModel )
void CLegacyCineMonster :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void CLegacyCineMonster :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
pev->animtime = 0; // reset the sequence pev->animtime = 0; // reset the sequence
SetThink( CineThink ); SetThink( &CineThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -145,7 +145,7 @@ void CLegacyCineMonster :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, U
// //
void CLegacyCineMonster :: Die( void ) void CLegacyCineMonster :: Die( void )
{ {
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
} }
// //
@ -228,14 +228,14 @@ void CCineBlood :: BloodGush ( void )
void CCineBlood :: BloodStart ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void CCineBlood :: BloodStart ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
SetThink( BloodGush ); SetThink( &BloodGush );
pev->nextthink = gpGlobals->time;// now! pev->nextthink = gpGlobals->time;// now!
} }
void CCineBlood :: Spawn ( void ) void CCineBlood :: Spawn ( void )
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
SetUse ( BloodStart ); SetUse( &BloodStart );
pev->health = 20;//hacked health to count iterations pev->health = 20;//hacked health to count iterations
} }

2
dlls/h_cycler.cpp

@ -334,7 +334,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( &DefaultTouch );
} }

2
dlls/handgrenade.cpp

@ -103,7 +103,7 @@ void CHandGrenade::Holster( int skiplocal /* = 0 */ )
{ {
// no more grenades! // no more grenades!
m_pPlayer->pev->weapons &= ~(1<<WEAPON_HANDGRENADE); m_pPlayer->pev->weapons &= ~(1<<WEAPON_HANDGRENADE);
SetThink( DestroyItem ); SetThink( &DestroyItem );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }

6
dlls/headcrab.cpp

@ -324,7 +324,7 @@ void CHeadCrab :: RunTask ( Task_t *pTask )
if ( m_fSequenceFinished ) if ( m_fSequenceFinished )
{ {
TaskComplete(); TaskComplete();
ResetTouch(); SetTouch( NULL );
m_IdealActivity = ACT_IDLE; m_IdealActivity = ACT_IDLE;
} }
break; break;
@ -360,7 +360,7 @@ void CHeadCrab :: LeapTouch ( CBaseEntity *pOther )
pOther->TakeDamage( pev, pev, GetDamageAmount(), DMG_SLASH ); pOther->TakeDamage( pev, pev, GetDamageAmount(), DMG_SLASH );
} }
ResetTouch(); SetTouch( NULL );
} }
//========================================================= //=========================================================
@ -385,7 +385,7 @@ void CHeadCrab :: StartTask ( Task_t *pTask )
{ {
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pAttackSounds[0], GetSoundVolue(), ATTN_IDLE, 0, GetVoicePitch() ); EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pAttackSounds[0], GetSoundVolue(), ATTN_IDLE, 0, GetVoicePitch() );
m_IdealActivity = ACT_RANGE_ATTACK1; m_IdealActivity = ACT_RANGE_ATTACK1;
SetTouch ( LeapTouch ); SetTouch( &LeapTouch );
break; break;
} }
default: default:

8
dlls/healthkit.cpp

@ -207,7 +207,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u
} }
pev->nextthink = pev->ltime + 0.25; pev->nextthink = pev->ltime + 0.25;
SetThink(Off); SetThink( &Off);
// Time to recharge yet? // Time to recharge yet?
@ -243,7 +243,7 @@ void CWallHealth::Recharge(void)
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/medshot4.wav", 1.0, ATTN_NORM ); EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/medshot4.wav", 1.0, ATTN_NORM );
m_iJuice = gSkillData.healthchargerCapacity; m_iJuice = gSkillData.healthchargerCapacity;
pev->frame = 0; pev->frame = 0;
SetThink( SUB_DoNothing ); SetThink( &SUB_DoNothing );
} }
void CWallHealth::Off(void) void CWallHealth::Off(void)
@ -257,8 +257,8 @@ void CWallHealth::Off(void)
if ((!m_iJuice) && ( ( m_iReactivate = g_pGameRules->FlHealthChargerRechargeTime() ) > 0) ) if ((!m_iJuice) && ( ( m_iReactivate = g_pGameRules->FlHealthChargerRechargeTime() ) > 0) )
{ {
pev->nextthink = pev->ltime + m_iReactivate; pev->nextthink = pev->ltime + m_iReactivate;
SetThink(Recharge); SetThink( &Recharge);
} }
else else
SetThink( SUB_DoNothing ); SetThink( &SUB_DoNothing );
} }

4
dlls/hgrunt.cpp

@ -2393,7 +2393,7 @@ void CHGruntRepel::Spawn( void )
Precache( ); Precache( );
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
SetUse( RepelUse ); SetUse( &RepelUse );
} }
void CHGruntRepel::Precache( void ) void CHGruntRepel::Precache( void )
@ -2423,7 +2423,7 @@ void CHGruntRepel::RepelUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE
pBeam->PointEntInit( pev->origin + Vector(0,0,112), pGrunt->entindex() ); pBeam->PointEntInit( pev->origin + Vector(0,0,112), pGrunt->entindex() );
pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetFlags( BEAM_FSOLID );
pBeam->SetColor( 255, 255, 255 ); pBeam->SetColor( 255, 255, 255 );
pBeam->SetThink( SUB_Remove ); pBeam->SetThink( &SUB_Remove );
pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5; pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5;
UTIL_Remove( this ); UTIL_Remove( this );

18
dlls/hornet.cpp

@ -93,8 +93,8 @@ void CHornet :: Spawn( void )
SET_MODEL(ENT( pev ), "models/hornet.mdl"); SET_MODEL(ENT( pev ), "models/hornet.mdl");
UTIL_SetSize( pev, Vector( -4, -4, -4 ), Vector( 4, 4, 4 ) ); UTIL_SetSize( pev, Vector( -4, -4, -4 ), Vector( 4, 4, 4 ) );
SetTouch( DieTouch ); SetTouch( &DieTouch );
SetThink( StartTrack ); SetThink( &StartTrack );
edict_t *pSoundEnt = pev->owner; edict_t *pSoundEnt = pev->owner;
if ( !pSoundEnt ) if ( !pSoundEnt )
@ -169,8 +169,8 @@ void CHornet :: StartTrack ( void )
{ {
IgniteTrail(); IgniteTrail();
SetTouch( TrackTouch ); SetTouch( &TrackTouch );
SetThink( TrackTarget ); SetThink( &TrackTarget );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -182,9 +182,9 @@ void CHornet :: StartDart ( void )
{ {
IgniteTrail(); IgniteTrail();
SetTouch( DartTouch ); SetTouch( &DartTouch );
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 4; pev->nextthink = gpGlobals->time + 4;
} }
@ -256,8 +256,8 @@ void CHornet :: TrackTarget ( void )
if (gpGlobals->time > m_flStopAttack) if (gpGlobals->time > m_flStopAttack)
{ {
ResetTouch(); SetTouch( NULL );
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
return; return;
} }
@ -413,7 +413,7 @@ void CHornet::DieTouch ( CBaseEntity *pOther )
pev->modelindex = 0;// so will disappear for the 0.1 secs we wait until NEXTTHINK gets rid pev->modelindex = 0;// so will disappear for the 0.1 secs we wait until NEXTTHINK gets rid
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
SetThink ( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 1;// stick around long enough for the sound to finish! pev->nextthink = gpGlobals->time + 1;// stick around long enough for the sound to finish!
} }

2
dlls/hornetgun.cpp

@ -235,7 +235,7 @@ void CHgun::SecondaryAttack( void )
pHornet->pev->velocity = gpGlobals->v_forward * 1200; pHornet->pev->velocity = gpGlobals->v_forward * 1200;
pHornet->pev->angles = UTIL_VecToAngles( pHornet->pev->velocity ); pHornet->pev->angles = UTIL_VecToAngles( pHornet->pev->velocity );
pHornet->SetThink( CHornet::StartDart ); pHornet->SetThink( &CHornet::StartDart );
m_flRechargeTime = gpGlobals->time + 0.5; m_flRechargeTime = gpGlobals->time + 0.5;
#endif #endif

4
dlls/ichthyosaur.cpp

@ -494,8 +494,8 @@ void CIchthyosaur :: Spawn()
MonsterInit(); MonsterInit();
SetTouch( BiteTouch ); SetTouch( &BiteTouch );
SetUse( CombatUse ); SetUse( &CombatUse );
m_idealDist = 384; m_idealDist = 384;
m_flMinSpeed = 80; m_flMinSpeed = 80;

10
dlls/items.cpp

@ -93,7 +93,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( &ItemTouch);
if (DROP_TO_FLOOR(ENT(pev)) == 0) if (DROP_TO_FLOOR(ENT(pev)) == 0)
{ {
@ -125,7 +125,7 @@ void CItem::ItemTouch( CBaseEntity *pOther )
if (MyTouch( pPlayer )) if (MyTouch( pPlayer ))
{ {
SUB_UseTargets( pOther, USE_TOGGLE, 0 ); SUB_UseTargets( pOther, USE_TOGGLE, 0 );
ResetTouch(); SetTouch( NULL );
// player grabbed the item. // player grabbed the item.
g_pGameRules->PlayerGotItem( pPlayer, this ); g_pGameRules->PlayerGotItem( pPlayer, this );
@ -146,12 +146,12 @@ void CItem::ItemTouch( CBaseEntity *pOther )
CBaseEntity* CItem::Respawn( void ) CBaseEntity* CItem::Respawn( void )
{ {
ResetTouch(); SetTouch( NULL );
pev->effects |= EF_NODRAW; pev->effects |= EF_NODRAW;
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( &Materialize );
pev->nextthink = g_pGameRules->FlItemRespawnTime( this ); pev->nextthink = g_pGameRules->FlItemRespawnTime( this );
return this; return this;
} }
@ -166,7 +166,7 @@ void CItem::Materialize( void )
pev->effects |= EF_MUZZLEFLASH; pev->effects |= EF_MUZZLEFLASH;
} }
SetTouch( ItemTouch ); SetTouch( &ItemTouch );
} }
#define SF_SUIT_SHORTLOGON 0x0001 #define SF_SUIT_SHORTLOGON 0x0001

10
dlls/leech.cpp

@ -196,9 +196,9 @@ void CLeech::Spawn( void )
m_flFieldOfView = -0.5; // 180 degree FOV m_flFieldOfView = -0.5; // 180 degree FOV
m_flDistLook = 750; m_flDistLook = 750;
MonsterInit(); MonsterInit();
SetThink( SwimThink ); SetThink( &SwimThink );
ResetUse(); SetUse( NULL );
ResetTouch(); SetTouch( NULL );
pev->view_ofs = g_vecZero; pev->view_ofs = g_vecZero;
m_flTurning = 0; m_flTurning = 0;
@ -426,7 +426,7 @@ void CLeech::DeadThink( void )
{ {
if ( m_Activity == ACT_DIEFORWARD ) if ( m_Activity == ACT_DIEFORWARD )
{ {
ResetThink(); SetThink( NULL );
StopAnimation(); StopAnimation();
return; return;
} }
@ -717,7 +717,7 @@ void CLeech::Killed(entvars_t *pevAttacker, int iGib)
pev->movetype = MOVETYPE_TOSS; pev->movetype = MOVETYPE_TOSS;
pev->takedamage = DAMAGE_NO; pev->takedamage = DAMAGE_NO;
SetThink( DeadThink ); SetThink( &DeadThink );
} }

18
dlls/monstermaker.cpp

@ -111,29 +111,29 @@ void CMonsterMaker :: Spawn( )
{ {
if ( pev->spawnflags & SF_MONSTERMAKER_CYCLIC ) if ( pev->spawnflags & SF_MONSTERMAKER_CYCLIC )
{ {
SetUse ( CyclicUse );// drop one monster each time we fire SetUse( &CyclicUse );// drop one monster each time we fire
} }
else else
{ {
SetUse ( ToggleUse );// so can be turned on/off SetUse( &ToggleUse );// so can be turned on/off
} }
if ( FBitSet ( pev->spawnflags, SF_MONSTERMAKER_START_ON ) ) if ( FBitSet ( pev->spawnflags, SF_MONSTERMAKER_START_ON ) )
{// start making monsters as soon as monstermaker spawns {// start making monsters as soon as monstermaker spawns
m_fActive = TRUE; m_fActive = TRUE;
SetThink ( MakerThink ); SetThink( &MakerThink );
} }
else else
{// wait to be activated. {// wait to be activated.
m_fActive = FALSE; m_fActive = FALSE;
SetThink ( SUB_DoNothing ); SetThink( &SUB_DoNothing );
} }
} }
else else
{// no targetname, just start. {// no targetname, just start.
pev->nextthink = gpGlobals->time + m_flDelay; pev->nextthink = gpGlobals->time + m_flDelay;
m_fActive = TRUE; m_fActive = TRUE;
SetThink ( MakerThink ); SetThink( &MakerThink );
} }
if ( m_cNumMonsters == 1 ) if ( m_cNumMonsters == 1 )
@ -229,8 +229,8 @@ void CMonsterMaker::MakeMonster( void )
if ( m_cNumMonsters == 0 ) if ( m_cNumMonsters == 0 )
{ {
// Disable this forever. Don't kill it because it still gets death notices // Disable this forever. Don't kill it because it still gets death notices
ResetThink(); SetThink( NULL );
ResetUse(); SetUse( NULL );
} }
} }
@ -254,12 +254,12 @@ void CMonsterMaker :: ToggleUse ( CBaseEntity *pActivator, CBaseEntity *pCaller,
if ( m_fActive ) if ( m_fActive )
{ {
m_fActive = FALSE; m_fActive = FALSE;
ResetThink(); SetThink( NULL );
} }
else else
{ {
m_fActive = TRUE; m_fActive = TRUE;
SetThink ( MakerThink ); SetThink( &MakerThink );
} }
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;

10
dlls/monsters.cpp

@ -2044,9 +2044,9 @@ void CBaseMonster :: MonsterInit ( void )
// set eye position // set eye position
SetEyePosition(); SetEyePosition();
SetThink( MonsterInitThink ); SetThink( &MonsterInitThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetUse ( MonsterUse ); SetUse( &MonsterUse );
} }
//========================================================= //=========================================================
@ -2146,7 +2146,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( &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
@ -3259,7 +3259,7 @@ void CBaseMonster::CorpseFallThink( void )
{ {
if ( pev->flags & FL_ONGROUND ) if ( pev->flags & FL_ONGROUND )
{ {
ResetThink(); SetThink( NULL );
SetSequenceBox( ); SetSequenceBox( );
UTIL_SetOrigin( pev, pev->origin );// link into world. UTIL_SetOrigin( pev, pev->origin );// link into world.
@ -3289,7 +3289,7 @@ void CBaseMonster :: MonsterInitDead( void )
// Setup health counters, etc. // Setup health counters, etc.
BecomeDead(); BecomeDead();
SetThink( CorpseFallThink ); SetThink( &CorpseFallThink );
pev->nextthink = gpGlobals->time + 0.5; pev->nextthink = gpGlobals->time + 0.5;
} }

6
dlls/mortar.cpp

@ -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( &FieldUse );
Precache(); Precache();
} }
@ -209,7 +209,7 @@ void CMortar::Spawn( )
pev->dmg = 200; pev->dmg = 200;
SetThink( MortarExplode ); SetThink( &MortarExplode );
pev->nextthink = 0; pev->nextthink = 0;
Precache( ); Precache( );
@ -300,7 +300,7 @@ void CMortar::MortarExplode( void )
} }
*/ */
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
#endif #endif

4
dlls/mpstubb.cpp

@ -50,7 +50,7 @@ void CBaseMonster::CorpseFallThink( void )
{ {
if ( pev->flags & FL_ONGROUND ) if ( pev->flags & FL_ONGROUND )
{ {
ResetThink(); SetThink( NULL );
SetSequenceBox( ); SetSequenceBox( );
UTIL_SetOrigin( pev, pev->origin );// link into world. UTIL_SetOrigin( pev, pev->origin );// link into world.
@ -79,7 +79,7 @@ void CBaseMonster :: MonsterInitDead( void )
// Setup health counters, etc. // Setup health counters, etc.
BecomeDead(); BecomeDead();
SetThink( CorpseFallThink ); SetThink( &CorpseFallThink );
pev->nextthink = gpGlobals->time + 0.5; pev->nextthink = gpGlobals->time + 0.5;
} }

38
dlls/nihilanth.cpp

@ -300,7 +300,7 @@ void CNihilanth :: Spawn( void )
InitBoneControllers(); InitBoneControllers();
SetThink( StartupThink ); SetThink( &StartupThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
m_vecDesired = Vector( 1, 0, 0 ); m_vecDesired = Vector( 1, 0, 0 );
@ -378,9 +378,9 @@ void CNihilanth::NullThink( void )
void CNihilanth::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) void CNihilanth::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ {
SetThink( HuntThink ); SetThink( &HuntThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetUse( CommandUse ); SetUse( &CommandUse );
} }
@ -410,8 +410,8 @@ void CNihilanth::StartupThink( void )
} }
m_hRecharger = NULL; m_hRecharger = NULL;
SetThink( HuntThink); SetThink( &HuntThink);
SetUse( CommandUse ); SetUse( &CommandUse );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -544,7 +544,7 @@ void CNihilanth::CrashTouch( CBaseEntity *pOther )
// only crash if we hit something solid // only crash if we hit something solid
if ( pOther->pev->solid == SOLID_BSP) if ( pOther->pev->solid == SOLID_BSP)
{ {
ResetTouch(); SetTouch( NULL );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
} }
@ -846,7 +846,7 @@ void CNihilanth :: HuntThink( void )
// if dead, force cancelation of current animation // if dead, force cancelation of current animation
if (pev->health <= 0) if (pev->health <= 0)
{ {
SetThink( DyingThink ); SetThink( &DyingThink );
m_fSequenceFinished = TRUE; m_fSequenceFinished = TRUE;
return; return;
} }
@ -1330,8 +1330,8 @@ void CNihilanthHVR :: CircleInit( CBaseEntity *pTarget )
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0)); UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
SetThink( HoverThink ); SetThink( &HoverThink );
SetTouch( BounceTouch ); SetTouch( &BounceTouch );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
m_hTargetEnt = pTarget; m_hTargetEnt = pTarget;
@ -1433,8 +1433,8 @@ void CNihilanthHVR :: ZapInit( CBaseEntity *pEnemy )
pev->velocity = (pEnemy->pev->origin - pev->origin).Normalize() * 200; pev->velocity = (pEnemy->pev->origin - pev->origin).Normalize() * 200;
m_hEnemy = pEnemy; m_hEnemy = pEnemy;
SetThink( ZapThink ); SetThink( &ZapThink );
SetTouch( ZapTouch ); SetTouch( &ZapTouch );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "debris/zap4.wav", 1, ATTN_NORM, 0, 100 ); EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "debris/zap4.wav", 1, ATTN_NORM, 0, 100 );
@ -1447,7 +1447,7 @@ void CNihilanthHVR :: ZapThink( void )
// check world boundaries // check world boundaries
if (m_hEnemy == NULL || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096) if (m_hEnemy == NULL || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096)
{ {
ResetTouch(); SetTouch( NULL );
UTIL_Remove( this ); UTIL_Remove( this );
return; return;
} }
@ -1495,7 +1495,7 @@ void CNihilanthHVR :: ZapThink( void )
UTIL_EmitAmbientSound( edict(), tr.vecEndPos, "weapons/electro4.wav", 0.5, ATTN_NORM, 0, RANDOM_LONG( 140, 160 ) ); UTIL_EmitAmbientSound( edict(), tr.vecEndPos, "weapons/electro4.wav", 0.5, ATTN_NORM, 0, RANDOM_LONG( 140, 160 ) );
ResetTouch(); SetTouch( NULL );
UTIL_Remove( this ); UTIL_Remove( this );
pev->nextthink = gpGlobals->time + 0.2; pev->nextthink = gpGlobals->time + 0.2;
return; return;
@ -1535,7 +1535,7 @@ void CNihilanthHVR::ZapTouch( CBaseEntity *pOther )
} }
*/ */
ResetTouch(); SetTouch( NULL );
UTIL_Remove( this ); UTIL_Remove( this );
pev->nextthink = gpGlobals->time + 0.2; pev->nextthink = gpGlobals->time + 0.2;
} }
@ -1559,8 +1559,8 @@ void CNihilanthHVR :: TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBa
m_hTargetEnt = pTarget; m_hTargetEnt = pTarget;
m_hTouch = pTouch; m_hTouch = pTouch;
SetThink( TeleportThink ); SetThink( &TeleportThink );
SetTouch( TeleportTouch ); SetTouch( &TeleportTouch );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "x/x_teleattack1.wav", 1, 0.2, 0, 100 ); EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "x/x_teleattack1.wav", 1, 0.2, 0, 100 );
@ -1579,7 +1579,7 @@ void CNihilanthHVR :: GreenBallInit( )
SET_MODEL(edict(), "sprites/exit1.spr"); SET_MODEL(edict(), "sprites/exit1.spr");
SetTouch( RemoveTouch ); SetTouch( &RemoveTouch );
} }
@ -1631,7 +1631,7 @@ void CNihilanthHVR :: TeleportThink( void )
void CNihilanthHVR :: AbsorbInit( void ) void CNihilanthHVR :: AbsorbInit( void )
{ {
SetThink( DissipateThink ); SetThink( &DissipateThink );
pev->renderamt = 255; pev->renderamt = 255;
MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY );
@ -1669,7 +1669,7 @@ void CNihilanthHVR::TeleportTouch( CBaseEntity *pOther )
m_pNihilanth->MakeFriend( pev->origin ); m_pNihilanth->MakeFriend( pev->origin );
} }
ResetTouch(); SetTouch( NULL );
STOP_SOUND(edict(), CHAN_WEAPON, "x/x_teleattack1.wav" ); STOP_SOUND(edict(), CHAN_WEAPON, "x/x_teleattack1.wav" );
UTIL_Remove( this ); UTIL_Remove( this );
} }

12
dlls/nodes.cpp

@ -1459,12 +1459,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( &SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
else else
{ {
SetThink ( DropDelay ); SetThink( &DropDelay );
pev->nextthink = gpGlobals->time + 1; pev->nextthink = gpGlobals->time + 1;
} }
@ -1484,7 +1484,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( &CallBuildNodeGraph );
pev->nextthink = gpGlobals->time + 1; pev->nextthink = gpGlobals->time + 1;
} }
@ -1632,7 +1632,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( &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.
@ -1744,7 +1744,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( &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;
@ -3559,7 +3559,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( &DrawThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }

20
dlls/osprey.cpp

@ -167,8 +167,8 @@ void COsprey :: Spawn( void )
InitBoneControllers(); InitBoneControllers();
SetThink( FindAllThink ); SetThink( &FindAllThink );
SetUse( CommandUse ); SetUse( &CommandUse );
if (!(pev->spawnflags & SF_WAITFORTRIGGER)) if (!(pev->spawnflags & SF_WAITFORTRIGGER))
{ {
@ -225,7 +225,7 @@ void COsprey :: FindAllThink( void )
UTIL_Remove( this ); UTIL_Remove( this );
return; return;
} }
SetThink( FlyThink ); SetThink( &FlyThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
m_startTime = gpGlobals->time; m_startTime = gpGlobals->time;
} }
@ -257,7 +257,7 @@ void COsprey :: DeployThink( void )
vecSrc = pev->origin + vecForward * -64 + vecRight * -100 + vecUp * -96; vecSrc = pev->origin + vecForward * -64 + vecRight * -100 + vecUp * -96;
m_hRepel[3] = MakeGrunt( vecSrc ); m_hRepel[3] = MakeGrunt( vecSrc );
SetThink( HoverThink ); SetThink( &HoverThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -308,7 +308,7 @@ CBaseMonster *COsprey :: MakeGrunt( Vector vecSrc )
pBeam->PointEntInit( vecSrc + Vector(0,0,112), pGrunt->entindex() ); pBeam->PointEntInit( vecSrc + Vector(0,0,112), pGrunt->entindex() );
pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetFlags( BEAM_FSOLID );
pBeam->SetColor( 255, 255, 255 ); pBeam->SetColor( 255, 255, 255 );
pBeam->SetThink( SUB_Remove ); pBeam->SetThink( &SUB_Remove );
pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5; pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5;
// ALERT( at_console, "%d at %.0f %.0f %.0f\n", i, m_vecOrigin[i].x, m_vecOrigin[i].y, m_vecOrigin[i].z ); // ALERT( at_console, "%d at %.0f %.0f %.0f\n", i, m_vecOrigin[i].x, m_vecOrigin[i].y, m_vecOrigin[i].z );
@ -336,7 +336,7 @@ void COsprey :: HoverThink( void )
if (i == 4) if (i == 4)
{ {
m_startTime = gpGlobals->time; m_startTime = gpGlobals->time;
SetThink( FlyThink ); SetThink( &FlyThink );
} }
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
@ -396,7 +396,7 @@ void COsprey::FlyThink( void )
{ {
if (m_pGoalEnt->pev->speed == 0) if (m_pGoalEnt->pev->speed == 0)
{ {
SetThink( DeployThink ); SetThink( &DeployThink );
} }
do { do {
m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME ( NULL, STRING( m_pGoalEnt->pev->target ) ) ); m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME ( NULL, STRING( m_pGoalEnt->pev->target ) ) );
@ -518,8 +518,8 @@ void COsprey :: Killed( entvars_t *pevAttacker, int iGib )
STOP_SOUND( ENT(pev), CHAN_STATIC, "apache/ap_rotor4.wav" ); STOP_SOUND( ENT(pev), CHAN_STATIC, "apache/ap_rotor4.wav" );
UTIL_SetSize( pev, Vector( -32, -32, -64), Vector( 32, 32, 0) ); UTIL_SetSize( pev, Vector( -32, -32, -64), Vector( 32, 32, 0) );
SetThink( DyingThink ); SetThink( &DyingThink );
SetTouch( CrashTouch ); SetTouch( &CrashTouch );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
pev->health = 0; pev->health = 0;
pev->takedamage = DAMAGE_NO; pev->takedamage = DAMAGE_NO;
@ -532,7 +532,7 @@ void COsprey::CrashTouch( CBaseEntity *pOther )
// only crash if we hit something solid // only crash if we hit something solid
if ( pOther->pev->solid == SOLID_BSP) if ( pOther->pev->solid == SOLID_BSP)
{ {
ResetTouch(); SetTouch( NULL );
m_startTime = gpGlobals->time; m_startTime = gpGlobals->time;
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
m_velocity = pev->velocity; m_velocity = pev->velocity;

2
dlls/pathcorner.cpp

@ -221,7 +221,7 @@ void CPathTrack :: Spawn( void )
m_pprevious = NULL; m_pprevious = NULL;
// DEBUGGING CODE // DEBUGGING CODE
#if PATH_SPARKLE_DEBUG #if PATH_SPARKLE_DEBUG
SetThink( Sparkle ); SetThink( &Sparkle );
pev->nextthink = gpGlobals->time + 0.5; pev->nextthink = gpGlobals->time + 0.5;
#endif #endif
} }

62
dlls/plats.cpp

@ -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( &PlatUse );
} }
else else
{ {
@ -417,7 +417,7 @@ void CFuncPlat :: PlatUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY
} }
else else
{ {
ResetUse(); SetUse( NULL );
if (m_toggle_state == TS_AT_TOP) if (m_toggle_state == TS_AT_TOP)
GoDown(); GoDown();
@ -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( &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( &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( &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( &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( &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( &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( &Next );
pev->nextthink = pev->ltime + 0.1; pev->nextthink = pev->ltime + 0.1;
} }
} }
@ -1047,7 +1047,7 @@ void CFuncTrackTrain :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_
pev->velocity = g_vecZero; pev->velocity = g_vecZero;
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
StopSound(); StopSound();
ResetThink(); SetThink( NULL );
} }
} }
else else
@ -1262,7 +1262,7 @@ void CFuncTrackTrain :: Next( void )
} }
} }
SetThink( Next ); SetThink( &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( &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( &Next );
pev->speed = m_startSpeed; pev->speed = m_startSpeed;
UpdateSound(); UpdateSound();
@ -1434,7 +1434,7 @@ void CFuncTrackTrain :: NearestPath( void )
if ( !pNearest ) if ( !pNearest )
{ {
ALERT( at_console, "Can't find a nearby track !!!\n" ); ALERT( at_console, "Can't find a nearby track !!!\n" );
ResetThink(); SetThink( NULL );
return; return;
} }
@ -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( &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( &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( &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( &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( &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( &Find );
} }
void CFuncTrackChange :: Find( void ) void CFuncTrackChange :: Find( void )
@ -1781,7 +1781,7 @@ void CFuncTrackChange :: Find( void )
m_trackBottom = m_trackBottom->Nearest( center ); m_trackBottom = m_trackBottom->Nearest( center );
m_trackTop = m_trackTop->Nearest( center ); m_trackTop = m_trackTop->Nearest( center );
UpdateAutoTargets( m_toggle_state ); UpdateAutoTargets( m_toggle_state );
ResetThink(); SetThink( NULL );
return; return;
} }
else else
@ -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( &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( &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( &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( &CallHitTop );
RotMove( m_end, pev->nextthink - pev->ltime ); RotMove( m_end, pev->nextthink - pev->ltime );
} }
@ -1980,7 +1980,7 @@ void CFuncTrackChange :: HitBottom( void )
// UpdateTrain(); // UpdateTrain();
m_train->SetTrack( m_trackBottom ); m_train->SetTrack( m_trackBottom );
} }
ResetThink(); SetThink( NULL );
pev->nextthink = -1; pev->nextthink = -1;
UpdateAutoTargets( m_toggle_state ); UpdateAutoTargets( m_toggle_state );
@ -2002,7 +2002,7 @@ void CFuncTrackChange :: HitTop( void )
} }
// Don't let the plat go back down // Don't let the plat go back down
ResetThink(); SetThink( NULL );
pev->nextthink = -1; pev->nextthink = -1;
UpdateAutoTargets( m_toggle_state ); UpdateAutoTargets( m_toggle_state );
EnableUse(); EnableUse();
@ -2160,7 +2160,7 @@ void CGunTarget::Spawn( void )
if ( pev->spawnflags & FGUNTARGET_START_ON ) if ( pev->spawnflags & FGUNTARGET_START_ON )
{ {
SetThink( Start ); SetThink( &Start );
pev->nextthink = pev->ltime + 0.3; pev->nextthink = pev->ltime + 0.3;
} }
} }
@ -2188,7 +2188,7 @@ void CGunTarget::Start( void )
void CGunTarget::Next( void ) void CGunTarget::Next( void )
{ {
ResetThink(); SetThink( NULL );
m_hTargetEnt = GetNextTarget(); m_hTargetEnt = GetNextTarget();
CBaseEntity *pTarget = m_hTargetEnt; CBaseEntity *pTarget = m_hTargetEnt;
@ -2198,7 +2198,7 @@ void CGunTarget::Next( void )
Stop(); Stop();
return; return;
} }
SetMoveDone( Wait ); SetMoveDone( &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( &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;

16
dlls/player.cpp

@ -774,7 +774,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;
// back these two lists up to their first elements // back these two lists up to their first elements
@ -933,7 +933,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( &PlayerDeathThink);
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -3209,7 +3209,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( &Spray );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -3224,7 +3224,7 @@ void CBloodSplat::Spray ( void )
UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED ); UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED );
} }
SetThink ( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -3587,7 +3587,7 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse )
if ( pEntity ) if ( pEntity )
{ {
if ( pEntity->pev->takedamage ) if ( pEntity->pev->takedamage )
pEntity->SetThink(SUB_Remove); pEntity->SetThink( &SUB_Remove);
} }
break; break;
} }
@ -3663,7 +3663,7 @@ int CBasePlayer::RemovePlayerItem( CBasePlayerItem *pItem )
ResetAutoaim( ); ResetAutoaim( );
pItem->Holster( ); pItem->Holster( );
pItem->pev->nextthink = 0;// crowbar may be trying to swing again, etc. pItem->pev->nextthink = 0;// crowbar may be trying to swing again, etc.
pItem->ResetThink(); pItem->SetThink( NULL );
m_pActiveItem = NULL; m_pActiveItem = NULL;
pev->viewmodel = 0; pev->viewmodel = 0;
pev->weaponmodel = 0; pev->weaponmodel = 0;
@ -4726,7 +4726,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( &MessageThink );
} }
@ -4737,7 +4737,7 @@ void CRevertSaved :: MessageThink( void )
if ( nextThink > 0 ) if ( nextThink > 0 )
{ {
pev->nextthink = gpGlobals->time + nextThink; pev->nextthink = gpGlobals->time + nextThink;
SetThink( LoadThink ); SetThink( &LoadThink );
} }
else else
LoadThink(); LoadThink();

24
dlls/prop.cpp

@ -566,7 +566,7 @@ void CProp::Killed(entvars_t *pevAttacker, int iGib)
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->effects |= EF_NODRAW; pev->effects |= EF_NODRAW;
pev->nextthink = gpGlobals->time + m_flRespawnTime; pev->nextthink = gpGlobals->time + m_flRespawnTime;
SetThink( CProp::RespawnThink ); SetThink( &CProp::RespawnThink );
ResetTouch( ); ResetTouch( );
ResetUse( ); ResetUse( );
} }
@ -605,7 +605,7 @@ void CProp::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType,
m_pHolstered->pev->weaponmodel = 0; m_pHolstered->pev->weaponmodel = 0;
m_pHolstered->pev->viewmodel = 0; m_pHolstered->pev->viewmodel = 0;
} }
SetThink( CProp::DeployThink ); SetThink( &CProp::DeployThink );
pev->nextthink = gpGlobals->time + 0.2; pev->nextthink = gpGlobals->time + 0.2;
} }
} }
@ -664,7 +664,7 @@ void CProp::Force(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTyp
} }
pev->nextthink = gpGlobals->time + m_flRespawnTime; pev->nextthink = gpGlobals->time + m_flRespawnTime;
SetThink(CProp::RespawnThink); SetThink( &CProp::RespawnThink);
} }
void CProp::CheckRotate() void CProp::CheckRotate()
@ -739,7 +739,7 @@ void CProp::DeployThink( void )
if( m_pfnThink == &CProp::DeployThink ) if( m_pfnThink == &CProp::DeployThink )
{ {
pev->nextthink = gpGlobals->time + m_flRespawnTime; pev->nextthink = gpGlobals->time + m_flRespawnTime;
SetThink( CProp::RespawnThink ); SetThink( &CProp::RespawnThink );
} }
} }
@ -899,8 +899,8 @@ void CProp::PropRespawn()
m_oldshape = (PropShape)-1; m_oldshape = (PropShape)-1;
CheckRotate(); CheckRotate();
pev->health = m_flSpawnHealth; pev->health = m_flSpawnHealth;
SetTouch(CProp::BounceTouch); SetTouch( &CProp::BounceTouch);
SetUse(CProp::Use); SetUse( &CProp::Use);
pev->effects &= ~EF_NODRAW; pev->effects &= ~EF_NODRAW;
pev->framerate = 1.0f; pev->framerate = 1.0f;
} }
@ -917,7 +917,7 @@ void CProp::RespawnThink()
void CProp::AngleThink() void CProp::AngleThink()
{ {
pev->nextthink = gpGlobals->time + m_flRespawnTime; pev->nextthink = gpGlobals->time + m_flRespawnTime;
SetThink(CProp::RespawnThink); SetThink( &CProp::RespawnThink);
if (!(pev->flags & FL_ONGROUND || fabs(pev->velocity.z) < 40)) if (!(pev->flags & FL_ONGROUND || fabs(pev->velocity.z) < 40))
{ {
m_owner2 = m_attacker = 0; m_owner2 = m_attacker = 0;
@ -928,7 +928,7 @@ void CProp::AngleThink()
pev->angles.z += UTIL_AngleDiff(90, pev->angles.z) * 0.7; pev->angles.z += UTIL_AngleDiff(90, pev->angles.z) * 0.7;
if (fabs(UTIL_AngleDiff(90, pev->angles.z)) > 0.1) if (fabs(UTIL_AngleDiff(90, pev->angles.z)) > 0.1)
{ {
SetThink(CProp::AngleThink); SetThink( &CProp::AngleThink);
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
//ALERT( at_console, "AngleThink: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z ); //ALERT( at_console, "AngleThink: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z );
@ -938,7 +938,7 @@ void CProp::AngleThink()
{ {
if (fabs(UTIL_AngleDiff(90, pev->angles.z)) > 0.1) if (fabs(UTIL_AngleDiff(90, pev->angles.z)) > 0.1)
{ {
SetThink(CProp::AngleThink); SetThink( &CProp::AngleThink);
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
pev->angles.z += UTIL_AngleDiff(0, pev->angles.z) * 0.7; pev->angles.z += UTIL_AngleDiff(0, pev->angles.z) * 0.7;
@ -955,7 +955,7 @@ void CProp::AngleThink()
//fabs(UTIL_AngleDiff(iangles.y, pev->angles.y)) > 0.1 || //fabs(UTIL_AngleDiff(iangles.y, pev->angles.y)) > 0.1 ||
fabs(UTIL_AngleDiff(iangles.z, pev->angles.z)) > 0.1) fabs(UTIL_AngleDiff(iangles.z, pev->angles.z)) > 0.1)
{ {
SetThink(CProp::AngleThink); SetThink( &CProp::AngleThink);
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
pev->angles.x += UTIL_AngleDiff(iangles.x, pev->angles.x) * 0.6; pev->angles.x += UTIL_AngleDiff(iangles.x, pev->angles.x) * 0.6;
@ -972,7 +972,7 @@ void CProp::AngleThink()
fabs(UTIL_AngleDiff(iangles.y, pev->angles.y)) > 0.1 || fabs(UTIL_AngleDiff(iangles.y, pev->angles.y)) > 0.1 ||
fabs(UTIL_AngleDiff(iangles.z, pev->angles.z)) > 0.1) fabs(UTIL_AngleDiff(iangles.z, pev->angles.z)) > 0.1)
{ {
SetThink(CProp::AngleThink); SetThink( &CProp::AngleThink);
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
pev->angles.x += UTIL_AngleDiff(iangles.x, pev->angles.x) * 0.6; pev->angles.x += UTIL_AngleDiff(iangles.x, pev->angles.x) * 0.6;
@ -1006,7 +1006,7 @@ void CProp::AngleThink()
if (fabs(UTIL_AngleDiff(ianglex, pev->angles.x)) > 0.1 || if (fabs(UTIL_AngleDiff(ianglex, pev->angles.x)) > 0.1 ||
fabs(UTIL_AngleDiff(ianglez, pev->angles.z)) > 0.1 ) fabs(UTIL_AngleDiff(ianglez, pev->angles.z)) > 0.1 )
{ {
SetThink(CProp::AngleThink); SetThink( &CProp::AngleThink);
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
pev->angles.x += UTIL_AngleDiff(ianglex, pev->angles.x) * 0.6; pev->angles.x += UTIL_AngleDiff(ianglex, pev->angles.x) * 0.6;

5
dlls/replace.sh

@ -0,0 +1,5 @@
f="effects.h *.cpp"
for m in SetThink SetTouch SetUse SetBlocked SetMoveDone; do
m2=`echo $m|sed -e s/Set/Reset/`
sed -e s/$m[[:space:]]\*\([[:space:]]\*/$m\(/g -e s/$m\([[:space:]]\*\\\&/$m\(/g -e s/$m\([[:space:]]\*NULL[[:space:]]\)/$m2\(\)/g -e s/$m\([[:space:]]*/$m\(\ \\\&/g -e s/$m2\(\)/$m\(\ NULL\ \)/g -i $f
done

12
dlls/rpg.cpp

@ -80,7 +80,7 @@ void CLaserSpot::Suspend( float flSuspendTime )
{ {
pev->effects |= EF_NODRAW; pev->effects |= EF_NODRAW;
SetThink( Revive ); SetThink( &Revive );
pev->nextthink = gpGlobals->time + flSuspendTime; pev->nextthink = gpGlobals->time + flSuspendTime;
} }
@ -91,7 +91,7 @@ void CLaserSpot::Revive( void )
{ {
pev->effects &= ~EF_NODRAW; pev->effects &= ~EF_NODRAW;
ResetThink(); SetThink( NULL );
} }
void CLaserSpot::Precache( void ) void CLaserSpot::Precache( void )
@ -110,7 +110,7 @@ CRpgRocket *CRpgRocket::CreateRpgRocket( Vector vecOrigin, Vector vecAngles, CBa
UTIL_SetOrigin( pRocket->pev, vecOrigin ); UTIL_SetOrigin( pRocket->pev, vecOrigin );
pRocket->pev->angles = vecAngles; pRocket->pev->angles = vecAngles;
pRocket->Spawn(); pRocket->Spawn();
pRocket->SetTouch( CRpgRocket::RocketTouch ); pRocket->SetTouch( &CRpgRocket::RocketTouch );
pRocket->m_pLauncher = pLauncher;// remember what RPG fired me. pRocket->m_pLauncher = pLauncher;// remember what RPG fired me.
pRocket->m_pLauncher->m_cActiveRockets++;// register this missile as active for the launcher pRocket->m_pLauncher->m_cActiveRockets++;// register this missile as active for the launcher
pRocket->pev->owner = pOwner->edict(); pRocket->pev->owner = pOwner->edict();
@ -133,8 +133,8 @@ void CRpgRocket :: Spawn( void )
pev->classname = MAKE_STRING("rpg_rocket"); pev->classname = MAKE_STRING("rpg_rocket");
SetThink( IgniteThink ); SetThink( &IgniteThink );
SetTouch( ExplodeTouch ); SetTouch( &ExplodeTouch );
pev->angles.x -= 30; pev->angles.x -= 30;
UTIL_MakeVectors( pev->angles ); UTIL_MakeVectors( pev->angles );
@ -200,7 +200,7 @@ void CRpgRocket :: IgniteThink( void )
m_flIgniteTime = gpGlobals->time; m_flIgniteTime = gpGlobals->time;
// set to follow laser spot // set to follow laser spot
SetThink( FollowThink ); SetThink( &FollowThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }

8
dlls/satchel.cpp

@ -77,9 +77,9 @@ void CSatchelCharge :: Spawn( void )
UTIL_SetSize(pev, Vector( -4, -4, -4), Vector(4, 4, 4)); // Uses point-sized, and can be stepped over UTIL_SetSize(pev, Vector( -4, -4, -4), Vector(4, 4, 4)); // Uses point-sized, and can be stepped over
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
SetTouch( SatchelSlide ); SetTouch( &SatchelSlide );
SetUse( DetonateUse ); SetUse( &DetonateUse );
SetThink( SatchelThink ); SetThink( &SatchelThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
pev->gravity = 0.5; pev->gravity = 0.5;
@ -322,7 +322,7 @@ void CSatchel::Holster( int skiplocal /* = 0 */ )
if ( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] && !m_chargeReady ) if ( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] && !m_chargeReady )
{ {
m_pPlayer->pev->weapons &= ~(1<<WEAPON_SATCHEL); m_pPlayer->pev->weapons &= ~(1<<WEAPON_SATCHEL);
SetThink( DestroyItem ); SetThink( &DestroyItem );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
} }

2
dlls/schedule.cpp

@ -454,7 +454,7 @@ void CBaseMonster :: RunTask ( Task_t *pTask )
{ {
pev->deadflag = DEAD_DEAD; pev->deadflag = DEAD_DEAD;
ResetThink(); SetThink( NULL );
StopAnimation(); StopAnimation();
if ( !BBoxFlat() ) if ( !BBoxFlat() )

6
dlls/scientist.cpp

@ -686,7 +686,7 @@ void CScientist :: Spawn( void )
pev->skin = 1; pev->skin = 1;
MonsterInit(); MonsterInit();
SetUse( FollowerUse ); SetUse( &FollowerUse );
} }
//========================================================= //=========================================================
@ -813,7 +813,7 @@ void CScientist :: DeathSound ( void )
void CScientist::Killed( entvars_t *pevAttacker, int iGib ) void CScientist::Killed( entvars_t *pevAttacker, int iGib )
{ {
ResetUse(); SetUse( NULL );
CTalkMonster::Killed( pevAttacker, iGib ); CTalkMonster::Killed( pevAttacker, iGib );
} }
@ -1240,7 +1240,7 @@ void CSittingScientist :: Spawn( )
pev->sequence = m_baseSequence + RANDOM_LONG(0,4); pev->sequence = m_baseSequence + RANDOM_LONG(0,4);
ResetSequenceInfo( ); ResetSequenceInfo( );
SetThink (SittingThink); SetThink( &SittingThink);
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
DROP_TO_FLOOR ( ENT(pev) ); DROP_TO_FLOOR ( ENT(pev) );

28
dlls/scripted.cpp

@ -142,7 +142,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( &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 )
@ -198,7 +198,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( &CineThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
} }
@ -253,7 +253,7 @@ void CCineMonster :: Touch( CBaseEntity *pOther )
// //
void CCineMonster :: Die( void ) void CCineMonster :: Die( void )
{ {
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
} }
// //
@ -564,7 +564,7 @@ void CCineMonster :: SequenceDone ( CBaseMonster *pMonster )
if ( !( pev->spawnflags & SF_SCRIPT_REPEATABLE ) ) if ( !( pev->spawnflags & SF_SCRIPT_REPEATABLE ) )
{ {
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -827,12 +827,12 @@ BOOL CBaseMonster :: CineCleanup( )
if ( pOldCine && FBitSet( pOldCine->pev->spawnflags, SF_SCRIPT_LEAVECORPSE ) ) if ( pOldCine && FBitSet( pOldCine->pev->spawnflags, SF_SCRIPT_LEAVECORPSE ) )
{ {
ResetUse(); // BUGBUG -- This doesn't call Killed() SetUse( NULL ); // BUGBUG -- This doesn't call Killed()
ResetThink(); // This will probably break some stuff SetThink( NULL ); // This will probably break some stuff
ResetTouch(); SetTouch( NULL );
} }
else else
SUB_StartFadeOut(); // SetThink( SUB_DoNothing ); SUB_StartFadeOut(); // SetThink( &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;
@ -1026,7 +1026,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( &FindThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -1039,7 +1039,7 @@ void CScriptedSentence :: Spawn( void )
// if no targetname, start now // if no targetname, start now
if ( !pev->targetname ) if ( !pev->targetname )
{ {
SetThink( FindThink ); SetThink( &FindThink );
pev->nextthink = gpGlobals->time + 1.0; pev->nextthink = gpGlobals->time + 1.0;
} }
@ -1078,7 +1078,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( &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) );
@ -1096,7 +1096,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( &FindThink );
} }
@ -1219,7 +1219,7 @@ LINK_ENTITY_TO_CLASS( monster_furniture, CFurniture );
//========================================================= //=========================================================
void CFurniture :: Die ( void ) void CFurniture :: Die ( void )
{ {
SetThink ( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
@ -1242,7 +1242,7 @@ void CFurniture :: Spawn( )
pev->frame = 0; pev->frame = 0;
// pev->nextthink += 1.0; // pev->nextthink += 1.0;
// SetThink (WalkMonsterDelay); // SetThink( &WalkMonsterDelay);
ResetSequenceInfo( ); ResetSequenceInfo( );
pev->frame = 0; pev->frame = 0;

12
dlls/sound.cpp

@ -193,7 +193,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( &SUB_Remove );
return; return;
} }
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
@ -203,12 +203,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( &RampThink);
pev->nextthink = 0; pev->nextthink = 0;
// allow on/off switching via 'use' function. // allow on/off switching via 'use' function.
SetUse ( ToggleUse ); SetUse( &ToggleUse );
m_fActive = FALSE; m_fActive = FALSE;
@ -1824,19 +1824,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( &SUB_Remove );
return; return;
} }
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
SetThink(SpeakerThink); SetThink( &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( &ToggleUse );
Precache( ); Precache( );
} }

12
dlls/squeakgrenade.cpp

@ -120,8 +120,8 @@ void CSqueakGrenade :: Spawn( void )
UTIL_SetSize(pev, Vector( -4, -4, 0), Vector(4, 4, 8)); UTIL_SetSize(pev, Vector( -4, -4, 0), Vector(4, 4, 8));
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
SetTouch( SuperBounceTouch ); SetTouch( &SuperBounceTouch );
SetThink( HuntThink ); SetThink( &HuntThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
m_flNextHunt = gpGlobals->time + 1E6; m_flNextHunt = gpGlobals->time + 1E6;
@ -162,8 +162,8 @@ void CSqueakGrenade::Precache( void )
void CSqueakGrenade :: Killed( entvars_t *pevAttacker, int iGib ) void CSqueakGrenade :: Killed( entvars_t *pevAttacker, int iGib )
{ {
pev->model = iStringNull;// make invisible pev->model = iStringNull;// make invisible
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
ResetTouch(); SetTouch( NULL );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
// since squeak grenades never leave a body behind, clear out their takedamage now. // since squeak grenades never leave a body behind, clear out their takedamage now.
@ -203,7 +203,7 @@ void CSqueakGrenade::HuntThink( void )
if (!IsInWorld()) if (!IsInWorld())
{ {
ResetTouch(); SetTouch( NULL );
UTIL_Remove( this ); UTIL_Remove( this );
return; return;
} }
@ -483,7 +483,7 @@ void CSqueak::Holster( int skiplocal /* = 0 */ )
if ( !m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] ) if ( !m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] )
{ {
m_pPlayer->pev->weapons &= ~(1<<WEAPON_SNARK); m_pPlayer->pev->weapons &= ~(1<<WEAPON_SNARK);
SetThink( DestroyItem ); SetThink( &DestroyItem );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
return; return;
} }

6
dlls/subs.cpp

@ -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( &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( &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( &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;

2
dlls/talkmonster.cpp

@ -640,7 +640,7 @@ void CTalkMonster :: Killed( entvars_t *pevAttacker, int iGib )
m_hTargetEnt = NULL; m_hTargetEnt = NULL;
// Don't finish that sentence // Don't finish that sentence
StopTalking(); StopTalking();
ResetUse(); SetUse( NULL );
CBaseMonster::Killed( pevAttacker, iGib ); CBaseMonster::Killed( pevAttacker, iGib );
} }

14
dlls/tentacle.cpp

@ -265,9 +265,9 @@ void CTentacle :: Spawn( )
m_bloodColor = BLOOD_COLOR_GREEN; m_bloodColor = BLOOD_COLOR_GREEN;
SetThink( Start ); SetThink( &Start );
SetTouch( HitTouch ); SetTouch( &HitTouch );
SetUse( CommandUse ); SetUse( &CommandUse );
pev->nextthink = gpGlobals->time + 0.2; pev->nextthink = gpGlobals->time + 0.2;
@ -288,7 +288,7 @@ void CTentacle :: Spawn( )
m_MonsterState = MONSTERSTATE_IDLE; m_MonsterState = MONSTERSTATE_IDLE;
// SetThink( Test ); // SetThink( &Test );
UTIL_SetOrigin( pev, pev->origin ); UTIL_SetOrigin( pev, pev->origin );
} }
@ -714,7 +714,7 @@ void CTentacle::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
{ {
case USE_OFF: case USE_OFF:
pev->takedamage = DAMAGE_NO; pev->takedamage = DAMAGE_NO;
SetThink( DieThink ); SetThink( &DieThink );
m_iGoalAnim = TENTACLE_ANIM_Engine_Death1; m_iGoalAnim = TENTACLE_ANIM_Engine_Death1;
break; break;
case USE_ON: case USE_ON:
@ -728,7 +728,7 @@ void CTentacle::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
break; break;
case USE_TOGGLE: case USE_TOGGLE:
pev->takedamage = DAMAGE_NO; pev->takedamage = DAMAGE_NO;
SetThink( DieThink ); SetThink( &DieThink );
m_iGoalAnim = TENTACLE_ANIM_Engine_Idle; m_iGoalAnim = TENTACLE_ANIM_Engine_Idle;
break; break;
} }
@ -926,7 +926,7 @@ void CTentacle :: HandleAnimEvent( MonsterEvent_t *pEvent )
// void CTentacle :: Start( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) // void CTentacle :: Start( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
void CTentacle :: Start( void ) void CTentacle :: Start( void )
{ {
SetThink( Cycle ); SetThink( &Cycle );
if ( !g_fFlySound ) if ( !g_fFlySound )
{ {

66
dlls/triggers.cpp

@ -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( &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( &ManagerUse );
SetThink ( ManagerThink); SetThink( &ManagerThink);
// Sort targets // Sort targets
// Quick and dirty bubble sort // Quick and dirty bubble sort
@ -397,13 +397,13 @@ void CMultiManager :: ManagerThink ( void )
if ( m_index >= m_cTargets )// have we fired all targets? if ( m_index >= m_cTargets )// have we fired all targets?
{ {
ResetThink(); SetThink( NULL );
if ( IsClone() ) if ( IsClone() )
{ {
UTIL_Remove( this ); UTIL_Remove( this );
return; return;
} }
SetUse ( ManagerUse );// allow manager re-use SetUse( &ManagerUse );// allow manager re-use
} }
else else
pev->nextthink = m_startTime + m_flTargetDelay[ m_index ]; pev->nextthink = m_startTime + m_flTargetDelay[ m_index ];
@ -442,9 +442,9 @@ void CMultiManager :: ManagerUse ( CBaseEntity *pActivator, CBaseEntity *pCaller
m_index = 0; m_index = 0;
m_startTime = gpGlobals->time; m_startTime = gpGlobals->time;
ResetUse();// disable use until all targets have fired SetUse( NULL );// disable use until all targets have fired
SetThink ( ManagerThink ); SetThink( &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( &ToggleUse );
} }
} }
@ -627,7 +627,7 @@ void CTriggerMonsterJump :: Think( void )
{ {
pev->solid = SOLID_NOT;// kill the trigger for now !!!UNDONE pev->solid = SOLID_NOT;// kill the trigger for now !!!UNDONE
UTIL_SetOrigin( pev, pev->origin ); // Unlink from trigger list UTIL_SetOrigin( pev, pev->origin ); // Unlink from trigger list
ResetThink(); SetThink( NULL );
} }
void CTriggerMonsterJump :: Touch( CBaseEntity *pOther ) void CTriggerMonsterJump :: Touch( CBaseEntity *pOther )
@ -729,7 +729,7 @@ void CTriggerCDAudio :: PlayTrack( void )
{ {
PlayCDTrack( (int)pev->health ); PlayCDTrack( (int)pev->health );
ResetTouch(); SetTouch( NULL );
UTIL_Remove( this ); UTIL_Remove( this );
} }
@ -808,20 +808,20 @@ void CTargetCDAudio::Play( void )
void CTriggerHurt :: Spawn( void ) void CTriggerHurt :: Spawn( void )
{ {
InitTrigger(); InitTrigger();
SetTouch ( HurtTouch ); SetTouch( &HurtTouch );
if ( !FStringNull ( pev->targetname ) ) if ( !FStringNull ( pev->targetname ) )
{ {
SetUse ( ToggleUse ); SetUse( &ToggleUse );
} }
else else
{ {
ResetUse(); SetUse( NULL );
} }
if (m_bitsDamageInflict & DMG_RADIATION) if (m_bitsDamageInflict & DMG_RADIATION)
{ {
SetThink ( RadiationThink ); SetThink( &RadiationThink );
pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5); pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5);
} }
@ -1080,7 +1080,7 @@ void CTriggerMultiple :: Spawn( void )
// } // }
// else // else
{ {
SetTouch( MultiTouch ); SetTouch( &MultiTouch );
} }
} }
@ -1177,16 +1177,16 @@ void CBaseTrigger :: ActivateMultiTrigger( CBaseEntity *pActivator )
if (m_flWait > 0) if (m_flWait > 0)
{ {
SetThink( MultiWaitOver ); SetThink( &MultiWaitOver );
pev->nextthink = gpGlobals->time + m_flWait; pev->nextthink = gpGlobals->time + m_flWait;
} }
else else
{ {
// we can't just remove (self) here, because this is a touch function // we can't just remove (self) here, because this is a touch function
// called while C code is looping through area links... // called while C code is looping through area links...
ResetTouch(); SetTouch( NULL );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
} }
} }
@ -1200,7 +1200,7 @@ void CBaseTrigger :: MultiWaitOver( void )
// pev->takedamage = DAMAGE_YES; // pev->takedamage = DAMAGE_YES;
// pev->solid = SOLID_BBOX; // pev->solid = SOLID_BBOX;
// } // }
ResetThink(); SetThink( NULL );
} }
@ -1266,7 +1266,7 @@ void CTriggerCounter :: Spawn( void )
if (m_cTriggersLeft == 0) if (m_cTriggersLeft == 0)
m_cTriggersLeft = 2; m_cTriggersLeft = 2;
SetUse( CounterUse ); SetUse( &CounterUse );
} }
// ====================== TRIGGER_CHANGELEVEL ================================ // ====================== TRIGGER_CHANGELEVEL ================================
@ -1411,11 +1411,11 @@ void CChangeLevel :: Spawn( void )
if (!FStringNull ( pev->targetname ) ) if (!FStringNull ( pev->targetname ) )
{ {
SetUse ( UseChangeLevel ); SetUse( &UseChangeLevel );
} }
InitTrigger(); InitTrigger();
if ( !(pev->spawnflags & SF_CHANGELEVEL_USEONLY) ) if ( !(pev->spawnflags & SF_CHANGELEVEL_USEONLY) )
SetTouch( TouchChangeLevel ); SetTouch( &TouchChangeLevel );
// ALERT( at_console, "TRANSITION: %s (%s)\n", m_szMapName, m_szLandmarkName ); // ALERT( at_console, "TRANSITION: %s (%s)\n", m_szMapName, m_szLandmarkName );
} }
@ -1732,7 +1732,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;
} }
} }
@ -1820,7 +1820,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( &ToggleUse );
UTIL_SetOrigin( pev, pev->origin ); // Link into the list UTIL_SetOrigin( pev, pev->origin ); // Link into the list
} }
@ -1938,7 +1938,7 @@ void CTriggerTeleport :: Spawn( void )
{ {
InitTrigger(); InitTrigger();
SetTouch( TeleportTouch ); SetTouch( &TeleportTouch );
} }
@ -1963,7 +1963,7 @@ void CTriggerSave::Spawn( void )
} }
InitTrigger(); InitTrigger();
SetTouch( SaveTouch ); SetTouch( &SaveTouch );
} }
void CTriggerSave::SaveTouch( CBaseEntity *pOther ) void CTriggerSave::SaveTouch( CBaseEntity *pOther )
@ -1975,7 +1975,7 @@ void CTriggerSave::SaveTouch( CBaseEntity *pOther )
if ( !pOther->IsPlayer() ) if ( !pOther->IsPlayer() )
return; return;
ResetTouch(); SetTouch( NULL );
UTIL_Remove( this ); UTIL_Remove( this );
SERVER_COMMAND( "autosave\n" ); SERVER_COMMAND( "autosave\n" );
} }
@ -1999,7 +1999,7 @@ void CTriggerEndSection::EndSectionUse( CBaseEntity *pActivator, CBaseEntity *pC
if ( pActivator && !pActivator->IsNetClient() ) if ( pActivator && !pActivator->IsNetClient() )
return; return;
ResetUse(); SetUse( NULL );
if ( pev->message ) if ( pev->message )
{ {
@ -2018,10 +2018,10 @@ void CTriggerEndSection::Spawn( void )
InitTrigger(); InitTrigger();
SetUse ( EndSectionUse ); SetUse( &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( &EndSectionTouch );
} }
void CTriggerEndSection::EndSectionTouch( CBaseEntity *pOther ) void CTriggerEndSection::EndSectionTouch( CBaseEntity *pOther )
@ -2030,7 +2030,7 @@ void CTriggerEndSection::EndSectionTouch( CBaseEntity *pOther )
if ( !pOther->IsNetClient() ) if ( !pOther->IsNetClient() )
return; return;
ResetTouch(); SetTouch( NULL );
if (pev->message) if (pev->message)
{ {
@ -2064,7 +2064,7 @@ LINK_ENTITY_TO_CLASS( trigger_gravity, CTriggerGravity );
void CTriggerGravity::Spawn( void ) void CTriggerGravity::Spawn( void )
{ {
InitTrigger(); InitTrigger();
SetTouch( GravityTouch ); SetTouch( &GravityTouch );
} }
void CTriggerGravity::GravityTouch( CBaseEntity *pOther ) void CTriggerGravity::GravityTouch( CBaseEntity *pOther )
@ -2321,7 +2321,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( &FollowTarget );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
m_moveDistance = 0; m_moveDistance = 0;

16
dlls/tripmine.cpp

@ -120,7 +120,7 @@ void CTripmineGrenade :: Spawn( void )
m_flPowerUp = gpGlobals->time + 2.5; m_flPowerUp = gpGlobals->time + 2.5;
} }
SetThink( PowerupThink ); SetThink( &PowerupThink );
pev->nextthink = gpGlobals->time + 0.2; pev->nextthink = gpGlobals->time + 0.2;
pev->takedamage = DAMAGE_YES; pev->takedamage = DAMAGE_YES;
@ -158,7 +158,7 @@ void CTripmineGrenade :: WarningThink( void )
// EMIT_SOUND( ENT(pev), CHAN_VOICE, "buttons/Blip2.wav", 1.0, ATTN_NORM ); // EMIT_SOUND( ENT(pev), CHAN_VOICE, "buttons/Blip2.wav", 1.0, ATTN_NORM );
// set to power up // set to power up
SetThink( PowerupThink ); SetThink( &PowerupThink );
pev->nextthink = gpGlobals->time + 1.0; pev->nextthink = gpGlobals->time + 1.0;
} }
@ -191,7 +191,7 @@ void CTripmineGrenade :: PowerupThink( void )
{ {
STOP_SOUND( ENT(pev), CHAN_VOICE, "weapons/mine_deploy.wav" ); STOP_SOUND( ENT(pev), CHAN_VOICE, "weapons/mine_deploy.wav" );
STOP_SOUND( ENT(pev), CHAN_BODY, "weapons/mine_charge.wav" ); STOP_SOUND( ENT(pev), CHAN_BODY, "weapons/mine_charge.wav" );
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
ALERT( at_console, "WARNING:Tripmine at %.0f, %.0f, %.0f removed\n", pev->origin.x, pev->origin.y, pev->origin.z ); ALERT( at_console, "WARNING:Tripmine at %.0f, %.0f, %.0f removed\n", pev->origin.x, pev->origin.y, pev->origin.z );
KillBeam(); KillBeam();
@ -206,7 +206,7 @@ void CTripmineGrenade :: PowerupThink( void )
CBaseEntity *pMine = Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles ); CBaseEntity *pMine = Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles );
pMine->pev->spawnflags |= SF_NORESPAWN; pMine->pev->spawnflags |= SF_NORESPAWN;
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
KillBeam(); KillBeam();
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
return; return;
@ -249,7 +249,7 @@ void CTripmineGrenade :: MakeBeam( void )
m_flBeamLength = tr.flFraction; m_flBeamLength = tr.flFraction;
// set to follow laser spot // set to follow laser spot
SetThink( BeamBreakThink ); SetThink( &BeamBreakThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
Vector vecTmpEnd = pev->origin + m_vecDir * 2048 * m_flBeamLength; Vector vecTmpEnd = pev->origin + m_vecDir * 2048 * m_flBeamLength;
@ -317,7 +317,7 @@ int CTripmineGrenade :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttac
{ {
// disable // disable
// Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles ); // Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles );
SetThink( SUB_Remove ); SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
KillBeam(); KillBeam();
return FALSE; return FALSE;
@ -335,7 +335,7 @@ void CTripmineGrenade::Killed( entvars_t *pevAttacker, int iGib )
pev->owner = ENT( pevAttacker ); pev->owner = ENT( pevAttacker );
} }
SetThink( DelayDeathThink ); SetThink( &DelayDeathThink );
pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.3 ); pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.3 );
EMIT_SOUND( ENT(pev), CHAN_BODY, "common/null.wav", 0.5, ATTN_NORM ); // shut off chargeup EMIT_SOUND( ENT(pev), CHAN_BODY, "common/null.wav", 0.5, ATTN_NORM ); // shut off chargeup
@ -420,7 +420,7 @@ void CTripmine::Holster( int skiplocal /* = 0 */ )
{ {
// out of mines // out of mines
m_pPlayer->pev->weapons &= ~(1<<WEAPON_TRIPMINE); m_pPlayer->pev->weapons &= ~(1<<WEAPON_TRIPMINE);
SetThink( DestroyItem ); SetThink( &DestroyItem );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }

58
dlls/turret.cpp

@ -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( &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( &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( &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( &AutoSearchThink);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
else else
SetThink(SUB_DoNothing); SetThink( &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( &Retire);
} }
else else
{ {
@ -411,7 +411,7 @@ void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_
m_iAutoStart = TRUE; m_iAutoStart = TRUE;
} }
SetThink(Deploy); SetThink( &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( &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( &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( &SearchThink);
return; return;
} }
} }
@ -670,7 +670,7 @@ void CBaseTurret::Deploy(void)
SetTurretAnim(TURRET_ANIM_SPIN); SetTurretAnim(TURRET_ANIM_SPIN);
pev->framerate = 0; pev->framerate = 0;
SetThink(SearchThink); SetThink( &SearchThink);
} }
m_flLastSight = gpGlobals->time + m_flMaxWait; m_flLastSight = gpGlobals->time + m_flMaxWait;
@ -710,11 +710,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( &AutoSearchThink);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
else else
SetThink(SUB_DoNothing); SetThink( &SUB_DoNothing);
} }
} }
else else
@ -746,7 +746,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( &ActiveThink);
m_iStartSpin = 0; m_iStartSpin = 0;
m_iSpin = 1; m_iSpin = 1;
} }
@ -758,7 +758,7 @@ void CTurret::SpinUpCall(void)
if (m_iSpin) if (m_iSpin)
{ {
SetThink(ActiveThink); SetThink( &ActiveThink);
} }
} }
@ -856,7 +856,7 @@ void CBaseTurret::SearchThink(void)
{ {
m_flLastSight = 0; m_flLastSight = 0;
m_flSpinUpTime = 0; m_flSpinUpTime = 0;
SetThink(ActiveThink); SetThink( &ActiveThink);
} }
else else
{ {
@ -866,7 +866,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( &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))
@ -911,7 +911,7 @@ void CBaseTurret::AutoSearchThink(void)
if (m_hEnemy != NULL) if (m_hEnemy != NULL)
{ {
SetThink(Deploy); SetThink( &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);
} }
} }
@ -979,7 +979,7 @@ void CBaseTurret :: TurretDeath( void )
if (m_fSequenceFinished && !MoveTurret( ) && pev->dmgtime + 5 < gpGlobals->time) if (m_fSequenceFinished && !MoveTurret( ) && pev->dmgtime + 5 < gpGlobals->time)
{ {
pev->framerate = 0; pev->framerate = 0;
ResetThink(); SetThink( NULL );
} }
} }
@ -1024,8 +1024,8 @@ 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???
ResetUse(); SetUse( NULL );
SetThink(TurretDeath); SetThink( &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;
@ -1037,7 +1037,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( &SearchThink);
} }
} }
@ -1179,8 +1179,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( &SentryTouch);
SetThink(Initialize); SetThink( &Initialize);
pev->nextthink = gpGlobals->time + 0.3; pev->nextthink = gpGlobals->time + 0.3;
} }
@ -1204,8 +1204,8 @@ int CSentry::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float f
if (!m_iOn) if (!m_iOn)
{ {
SetThink( Deploy ); SetThink( &Deploy );
ResetUse(); SetUse( NULL );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -1218,8 +1218,8 @@ 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???
ResetUse(); SetUse( NULL );
SetThink(SentryDeath); SetThink( &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;
@ -1299,7 +1299,7 @@ void CSentry :: SentryDeath( void )
if (m_fSequenceFinished && pev->dmgtime + 5 < gpGlobals->time) if (m_fSequenceFinished && pev->dmgtime + 5 < gpGlobals->time)
{ {
pev->framerate = 0; pev->framerate = 0;
ResetThink(); SetThink( NULL );
} }
} }

48
dlls/weapons.cpp

@ -477,8 +477,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( &DefaultTouch );
SetThink( FallThink ); SetThink( &FallThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -528,8 +528,8 @@ 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( &DefaultTouch);
ResetThink(); SetThink( NULL );
} }
@ -580,8 +580,8 @@ CBaseEntity* CBasePlayerItem::Respawn( void )
if ( pNewWeapon ) if ( pNewWeapon )
{ {
pNewWeapon->pev->effects |= EF_NODRAW;// invisible for now pNewWeapon->pev->effects |= EF_NODRAW;// invisible for now
pNewWeapon->ResetTouch();// no touch pNewWeapon->SetTouch( NULL );// no touch
pNewWeapon->SetThink( AttemptToMaterialize ); pNewWeapon->SetThink( &AttemptToMaterialize );
DROP_TO_FLOOR ( ENT(pev) ); DROP_TO_FLOOR ( ENT(pev) );
@ -738,15 +738,15 @@ int CBasePlayerItem::AddToPlayer( CBasePlayer *pPlayer )
void CBasePlayerItem::Drop( void ) void CBasePlayerItem::Drop( void )
{ {
ResetTouch(); SetTouch( NULL );
SetThink(SUB_Remove); SetThink( &SUB_Remove);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
void CBasePlayerItem::Kill( void ) void CBasePlayerItem::Kill( void )
{ {
ResetTouch(); SetTouch( NULL );
SetThink(SUB_Remove); SetThink( &SUB_Remove);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
@ -766,8 +766,8 @@ void CBasePlayerItem::AttachToPlayer ( CBasePlayer *pPlayer )
pev->model = iStringNull; pev->model = iStringNull;
pev->owner = pPlayer->edict(); pev->owner = pPlayer->edict();
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
ResetTouch(); SetTouch( NULL );
ResetThink(); SetThink( NULL );
} }
// CALLED THROUGH the newly-touched weapon's instance. The existing player weapon is pOriginal // CALLED THROUGH the newly-touched weapon's instance. The existing player weapon is pOriginal
@ -1066,17 +1066,17 @@ 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( &DefaultTouch );
} }
CBaseEntity* CBasePlayerAmmo::Respawn( void ) CBaseEntity* CBasePlayerAmmo::Respawn( void )
{ {
pev->effects |= EF_NODRAW; pev->effects |= EF_NODRAW;
ResetTouch(); SetTouch( NULL );
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( &Materialize );
pev->nextthink = g_pGameRules->FlAmmoRespawnTime( this ); pev->nextthink = g_pGameRules->FlAmmoRespawnTime( this );
return this; return this;
@ -1092,7 +1092,7 @@ void CBasePlayerAmmo::Materialize( void )
pev->effects |= EF_MUZZLEFLASH; pev->effects |= EF_MUZZLEFLASH;
} }
SetTouch( DefaultTouch ); SetTouch( &DefaultTouch );
} }
void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther ) void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther )
@ -1110,16 +1110,16 @@ void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther )
} }
else else
{ {
ResetTouch(); SetTouch( NULL );
SetThink(SUB_Remove); SetThink( &SUB_Remove);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
} }
else if (gEvilImpulse101) else if (gEvilImpulse101)
{ {
// evil impulse 101 hack, kill always // evil impulse 101 hack, kill always
ResetTouch(); SetTouch( NULL );
SetThink(SUB_Remove); SetThink( &SUB_Remove);
pev->nextthink = gpGlobals->time + .1; pev->nextthink = gpGlobals->time + .1;
} }
} }
@ -1256,7 +1256,7 @@ void CWeaponBox::Kill( void )
while ( pWeapon ) while ( pWeapon )
{ {
pWeapon->SetThink(SUB_Remove); pWeapon->SetThink( &SUB_Remove);
pWeapon->pev->nextthink = gpGlobals->time + 0.1; pWeapon->pev->nextthink = gpGlobals->time + 0.1;
pWeapon = pWeapon->m_pNext; pWeapon = pWeapon->m_pNext;
} }
@ -1334,7 +1334,7 @@ void CWeaponBox::Touch( CBaseEntity *pOther )
} }
EMIT_SOUND( pOther->edict(), CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM ); EMIT_SOUND( pOther->edict(), CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM );
ResetTouch(); SetTouch( NULL );
UTIL_Remove(this); UTIL_Remove(this);
} }
@ -1380,8 +1380,8 @@ BOOL CWeaponBox::PackWeapon( CBasePlayerItem *pWeapon )
pWeapon->pev->modelindex = 0; pWeapon->pev->modelindex = 0;
pWeapon->pev->model = iStringNull; pWeapon->pev->model = iStringNull;
pWeapon->pev->owner = edict(); pWeapon->pev->owner = edict();
pWeapon->ResetThink();// crowbar may be trying to swing again, etc. pWeapon->SetThink( NULL );// crowbar may be trying to swing again, etc.
pWeapon->ResetTouch(); pWeapon->SetTouch( NULL );
pWeapon->m_pPlayer = NULL; pWeapon->m_pPlayer = NULL;
//ALERT ( at_console, "packed %s\n", STRING(pWeapon->pev->classname) ); //ALERT ( at_console, "packed %s\n", STRING(pWeapon->pev->classname) );

10
dlls/world.cpp

@ -125,15 +125,15 @@ void CDecal :: Spawn( void )
if ( FStringNull ( pev->targetname ) ) if ( FStringNull ( pev->targetname ) )
{ {
SetThink( StaticDecal ); SetThink( &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( &SUB_DoNothing );
SetUse(TriggerDecal); SetUse( &TriggerDecal);
} }
} }
@ -158,7 +158,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( &SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1;
} }
@ -642,7 +642,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( &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;

Loading…
Cancel
Save