Browse Source

Add sed script and convert all SetXXX macros

pull/3/merge
mittorn 7 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
*.o
*.so
*/*.o
*/*/*.o
*.a
*.framework
*.exe

2
dlls/AI_BaseNPC_Schedule.cpp

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

18
dlls/aflock.cpp

@ -211,7 +211,7 @@ void CFlockingFlyerFlock :: SpawnFlock( void )
pBoid->pev->frame = 0;
pBoid->pev->nextthink = gpGlobals->time + 0.2;
pBoid->SetThink( CFlockingFlyer :: IdleThink );
pBoid->SetThink( &CFlockingFlyer :: IdleThink );
if ( pBoid != pLeader )
{
@ -229,7 +229,7 @@ void CFlockingFlyer :: Spawn( )
pev->frame = 0;
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) );
pev->movetype = MOVETYPE_TOSS;
SetThink ( FallHack );
SetThink( &FallHack );
pev->nextthink = gpGlobals->time + 0.1;
}
@ -308,7 +308,7 @@ void CFlockingFlyer :: FallHack( void )
else
{
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
if ( !FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) )
{
SetThink( Start );
SetThink( &Start );
pev->nextthink = gpGlobals->time + 0.1;
}
}
@ -380,11 +380,11 @@ void CFlockingFlyer :: Start( void )
if ( IsLeader() )
{
SetThink( FlockLeaderThink );
SetThink( &FlockLeaderThink );
}
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;
}
@ -673,7 +673,7 @@ void CFlockingFlyer :: FlockFollowerThink( void )
if ( IsLeader() || !InSquad() )
{
// the leader has been killed and this flyer suddenly finds himself the leader.
SetThink ( FlockLeaderThink );
SetThink( &FlockLeaderThink );
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_SetOrigin( pev, pev->origin );
SetTouch( TankTouch );
SetThink( TankThink );
SetTouch( &TankTouch );
SetThink( &TankThink );
pev->flags |= FL_MONSTER;
pev->takedamage = DAMAGE_YES;

26
dlls/apache.cpp

@ -139,12 +139,12 @@ void CApache :: Spawn( void )
if (pev->spawnflags & SF_WAITFORTRIGGER)
{
SetUse( StartupUse );
SetUse( &StartupUse );
}
else
{
SetThink( HuntThink );
SetTouch( FlyTouch );
SetThink( &HuntThink );
SetTouch( &FlyTouch );
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 )
{
SetThink( HuntThink );
SetTouch( FlyTouch );
SetThink( &HuntThink );
SetTouch( &FlyTouch );
pev->nextthink = gpGlobals->time + 0.1;
ResetUse();
SetUse( NULL );
}
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" );
UTIL_SetSize( pev, Vector( -32, -32, -64), Vector( 32, 32, 0) );
SetThink( DyingThink );
SetTouch( CrashTouch );
SetThink( &DyingThink );
SetTouch( &CrashTouch );
pev->nextthink = gpGlobals->time + 0.1;
pev->health = 0;
pev->takedamage = DAMAGE_NO;
@ -402,7 +402,7 @@ void CApache :: DyingThink( void )
WRITE_BYTE( BREAK_METAL );
MESSAGE_END();
SetThink( SUB_Remove );
SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1;
}
}
@ -426,7 +426,7 @@ void CApache::CrashTouch( CBaseEntity *pOther )
// only crash if we hit something solid
if ( pOther->pev->solid == SOLID_BSP)
{
ResetTouch();
SetTouch( NULL );
m_flNextRocket = 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_SetOrigin( pev, pev->origin );
SetThink( IgniteThink );
SetTouch( ExplodeTouch );
SetThink( &IgniteThink );
SetTouch( &ExplodeTouch );
UTIL_MakeAimVectors( pev->angles );
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)
// set to accelerate
SetThink( AccelerateThink );
SetThink( &AccelerateThink );
pev->nextthink = gpGlobals->time + 0.1;
}

6
dlls/barnacle.cpp

@ -137,7 +137,7 @@ void CBarnacle :: Spawn()
SetActivity ( ACT_IDLE );
SetThink ( BarnacleThink );
SetThink( &BarnacleThink );
pev->nextthink = gpGlobals->time + 0.5;
UTIL_SetOrigin ( pev, pev->origin );
@ -370,7 +370,7 @@ void CBarnacle :: Killed( entvars_t *pevAttacker, int iGib )
StudioFrameAdvance( 0.1 );
pev->nextthink = gpGlobals->time + 0.1;
SetThink ( WaitTillDead );
SetThink( &WaitTillDead );
}
//=========================================================
@ -386,7 +386,7 @@ void CBarnacle :: WaitTillDead ( void )
{
// death anim finished.
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;
MonsterInit();
SetUse( FollowerUse );
SetUse( &FollowerUse );
}
//=========================================================
@ -623,7 +623,7 @@ void CBarney::Killed( entvars_t *pevAttacker, int iGib )
CBaseEntity *pGun = DropItem( "weapon_9mmhandgun", vecGunPos, vecGunAngles );
}
ResetUse();
SetUse( NULL );
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->owner = pOwner;
pSpit->pev->scale = 2.5;
pSpit->SetThink ( Animate );
pSpit->SetThink( &Animate );
pSpit->pev->nextthink = gpGlobals->time + 0.1;
return pSpit;

36
dlls/bmodels.cpp

@ -419,7 +419,7 @@ void CFuncRotating :: Spawn( )
UTIL_SetOrigin(pev, pev->origin);
SET_MODEL( ENT(pev), STRING(pev->model) );
SetUse( RotatingUse );
SetUse( &RotatingUse );
// did level designer forget to assign speed?
if (pev->speed <= 0)
pev->speed = 0;
@ -431,13 +431,13 @@ void CFuncRotating :: Spawn( )
// instant-use brush?
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
}
// can this brush inflict pain?
if ( FBitSet (pev->spawnflags, SF_BRUSH_HURT) )
{
SetTouch( HurtTouch );
SetTouch( &HurtTouch );
}
Precache( );
@ -504,7 +504,7 @@ void CFuncRotating :: Precache( void )
// 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
SetThink ( SpinUp );
SetThink( &SpinUp );
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),
m_flVolume, m_flAttenuation, SND_CHANGE_PITCH | SND_CHANGE_VOL, FANPITCHMAX);
SetThink( Rotate );
SetThink( &Rotate );
Rotate();
}
else
@ -641,7 +641,7 @@ void CFuncRotating :: SpinDown( void )
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning /* Stop */),
0, 0, SND_STOP, m_pitch);
SetThink( Rotate );
SetThink( &Rotate );
Rotate();
}
else
@ -666,7 +666,7 @@ void CFuncRotating :: RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller
// fan is spinning, so stop it.
if ( pev->avelocity != g_vecZero )
{
SetThink ( SpinDown );
SetThink( &SpinDown );
//EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStop),
// 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
{
SetThink ( SpinUp );
SetThink( &SpinUp );
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning),
0.01, m_flAttenuation, 0, FANPITCHMIN);
@ -686,7 +686,7 @@ void CFuncRotating :: RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller
if ( pev->avelocity != g_vecZero )
{
// play stopping sound here
SetThink ( SpinDown );
SetThink( &SpinDown );
// EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStop),
// m_flVolume, m_flAttenuation, 0, m_pitch);
@ -700,7 +700,7 @@ void CFuncRotating :: RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller
m_flVolume, m_flAttenuation, 0, FANPITCHMAX);
pev->avelocity = pev->movedir * pev->speed;
SetThink( Rotate );
SetThink( &Rotate );
Rotate();
}
}
@ -812,15 +812,15 @@ void CPendulum :: Spawn( void )
if ( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT) )
{
SetThink( SUB_CallUseToggle );
SetThink( &SUB_CallUseToggle );
pev->nextthink = gpGlobals->time + 0.1;
}
pev->speed = 0;
SetUse( PendulumUse );
SetUse( &PendulumUse );
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->nextthink = pev->ltime + (delta / m_maxSpeed);
SetThink( Stop );
SetThink( &Stop );
}
else
{
pev->speed = 0; // Dead stop
ResetThink();
SetThink( NULL );
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
m_time = gpGlobals->time; // Save time to calculate dt
SetThink( Swing );
SetThink( &Swing );
m_dampSpeed = m_maxSpeed;
}
}
@ -860,7 +860,7 @@ void CPendulum :: Stop( void )
{
pev->angles = m_start;
pev->speed = 0;
ResetThink();
SetThink( NULL );
pev->avelocity = g_vecZero;
}
@ -901,7 +901,7 @@ void CPendulum :: Swing( void )
{
pev->angles = m_center;
pev->speed = 0;
ResetThink();
SetThink( NULL );
pev->avelocity = g_vecZero;
}
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->owner = ENT(pevOwner);
pSpit->SetThink ( Animate );
pSpit->SetThink( &Animate );
pSpit->pev->nextthink = gpGlobals->time + 0.1;
}
@ -172,7 +172,7 @@ void CSquidSpit :: Touch ( CBaseEntity *pOther )
pOther->TakeDamage ( pev, pev, gSkillData.bullsquidDmgSpit, DMG_GENERIC );
}
SetThink ( SUB_Remove );
SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time;
}

70
dlls/buttons.cpp

@ -173,7 +173,7 @@ void CMultiSource::Spawn()
pev->movetype = MOVETYPE_NONE;
pev->nextthink = gpGlobals->time + 0.1;
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 )
@ -240,7 +240,7 @@ void CMultiSource::Register(void)
m_iTotal = 0;
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)
@ -398,7 +398,7 @@ int CBaseButton::TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, fl
if ( code == BUTTON_NOTHING )
return 0;
// Temporarily disable the touch function, until movement is finished.
ResetTouch();
SetTouch( NULL );
m_hActivator = CBaseEntity::Instance( pevAttacker );
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
{
SetThink ( ButtonSpark );
SetThink( &ButtonSpark );
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
{
SetTouch( ButtonTouch );
SetTouch( &ButtonTouch );
}
else
{
ResetTouch();
SetUse ( ButtonUse );
SetTouch( NULL );
SetUse( &ButtonUse );
}
}
@ -567,7 +567,7 @@ void DoSpark(entvars_t *pev, const Vector &location )
void CBaseButton::ButtonSpark ( void )
{
SetThink ( ButtonSpark );
SetThink( &ButtonSpark );
pev->nextthink = gpGlobals->time + ( 0.1 + RANDOM_FLOAT ( 0, 1.5 ) );// spark again at random interval
DoSpark( pev, pev->mins );
@ -646,7 +646,7 @@ void CBaseButton:: ButtonTouch( CBaseEntity *pOther )
}
// Temporarily disable the touch function, until movement is finished.
ResetTouch();
SetTouch( NULL );
if ( code == BUTTON_RETURN )
{
@ -680,7 +680,7 @@ void CBaseButton::ButtonActivate( )
ASSERT(m_toggle_state == TS_AT_BOTTOM);
m_toggle_state = TS_GOING_UP;
SetMoveDone( TriggerAndWait );
SetMoveDone( &TriggerAndWait );
if (!m_fRotating)
LinearMove( m_vecPosition2, pev->speed);
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!
{
// ALL buttons are now use only
ResetTouch();
SetTouch( NULL );
}
else
SetTouch( ButtonTouch );
SetTouch( &ButtonTouch );
}
else
{
pev->nextthink = pev->ltime + m_flWait;
SetThink( ButtonReturn );
SetThink( &ButtonReturn );
}
pev->frame = 1; // use alternate textures
@ -732,7 +732,7 @@ void CBaseButton::ButtonReturn( void )
ASSERT(m_toggle_state == TS_AT_TOP);
m_toggle_state = TS_GOING_DOWN;
SetMoveDone( ButtonBackHome );
SetMoveDone( &ButtonBackHome );
if (!m_fRotating)
LinearMove( m_vecPosition1, pev->speed);
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!
{
// All buttons are now use only
ResetTouch();
SetTouch( NULL );
}
else
SetTouch( ButtonTouch );
SetTouch( &ButtonTouch );
// reset think for a sparking button
if ( FBitSet ( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) )
{
SetThink ( ButtonSpark );
SetThink( &ButtonSpark );
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 ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) )
{
ResetTouch();
SetUse ( ButtonUse );
SetTouch( NULL );
SetUse( &ButtonUse );
}
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->avelocity = (m_direction * pev->speed) * pev->movedir;
SetThink( Off );
SetThink( &Off );
}
void CMomentaryRotButton::UpdateTarget( float value )
@ -1077,12 +1077,12 @@ void CMomentaryRotButton::Off( void )
m_lastUsed = 0;
if ( FBitSet( pev->spawnflags, SF_PENDULUM_AUTO_RETURN ) && m_returnSpeed > 0 )
{
SetThink( Return );
SetThink( &Return );
pev->nextthink = pev->ltime + 0.1;
m_direction = -1;
}
else
ResetThink();
SetThink( NULL );
}
void CMomentaryRotButton::Return( void )
@ -1102,7 +1102,7 @@ void CMomentaryRotButton::UpdateSelfReturn( float value )
pev->avelocity = g_vecZero;
pev->angles = m_start;
pev->nextthink = -1;
ResetThink();
SetThink( NULL );
}
else
{
@ -1147,21 +1147,21 @@ LINK_ENTITY_TO_CLASS(env_debris, CEnvSpark);
void CEnvSpark::Spawn(void)
{
ResetThink();
ResetUse();
SetThink( NULL );
SetUse( NULL );
if (FBitSet(pev->spawnflags, 32)) // Use for on/off
{
if (FBitSet(pev->spawnflags, 64)) // Start on
{
SetThink(SparkThink); // start sparking
SetUse(SparkStop); // set up +USE to stop sparking
SetThink( &SparkThink); // start sparking
SetUse( &SparkStop); // set up +USE to stop sparking
}
else
SetUse(SparkStart);
SetUse( &SparkStart);
}
else
SetThink(SparkThink);
SetThink( &SparkThink);
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 )
{
SetUse(SparkStop);
SetThink(SparkThink);
SetUse( &SparkStop);
SetThink( &SparkThink);
pev->nextthink = gpGlobals->time + (0.1 + RANDOM_FLOAT ( 0, m_flDelay));
}
void EXPORT CEnvSpark::SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
SetUse(SparkStart);
ResetThink();
SetUse( &SparkStart);
SetThink( NULL );
}
#define SF_BTARGET_USE 0x0001

10
dlls/cbase.h

@ -373,10 +373,10 @@ public:
#else
#define SetThink( a ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (&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 SetBlocked( a ) m_pfnBlocked = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (&a)
#define SetThink( a ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (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 SetBlocked( a ) m_pfnBlocked = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (a)
#define ResetThink( ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (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)
@ -557,7 +557,7 @@ public:
// the button will be allowed to operate. Otherwise, it will be
// 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->solid = SOLID_BBOX;
UTIL_SetSize ( pGib->pev, Vector ( 0, 0 ,0 ), Vector ( 0, 0, 0 ) );
pGib->SetTouch ( StickyGibTouch );
pGib->ResetThink();
pGib->SetTouch( &StickyGibTouch );
pGib->SetThink( NULL );
}
pGib->LimitVelocity();
}
@ -331,7 +331,7 @@ void CBaseMonster :: GibMonster( void )
if ( gibbed )
{
// don't remove players!
SetThink ( SUB_Remove );
SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time;
}
else
@ -622,7 +622,7 @@ void CBaseMonster :: Killed( entvars_t *pevAttacker, int iGib )
}
else if ( pev->flags & FL_MONSTER )
{
ResetTouch();
SetTouch( NULL );
BecomeDead();
}
@ -654,7 +654,7 @@ void CBaseEntity :: SUB_StartFadeOut ( void )
pev->avelocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.1;
SetThink ( SUB_FadeOut );
SetThink( &SUB_FadeOut );
}
void CBaseEntity :: SUB_FadeOut ( void )
@ -668,7 +668,7 @@ void CBaseEntity :: SUB_FadeOut ( void )
{
pev->renderamt = 0;
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 )
{
SetThink (SUB_StartFadeOut);
SetThink( &SUB_StartFadeOut);
pev->nextthink = gpGlobals->time + m_lifeTime;
// If you bleed, you stink!
@ -756,7 +756,7 @@ void CGib :: StickyGibTouch ( CBaseEntity *pOther )
Vector vecSpot;
TraceResult tr;
SetThink ( SUB_Remove );
SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time + 10;
if ( !FClassnameIs( pOther->pev, "worldspawn" ) )
@ -797,8 +797,8 @@ void CGib :: Spawn( const char *szGibModel )
pev->nextthink = gpGlobals->time + 4;
m_lifeTime = 25;
SetThink ( WaitTillLand );
SetTouch ( BounceGibTouch );
SetThink( &WaitTillLand );
SetTouch( &BounceGibTouch );
m_material = matNone;
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_SetOrigin( pev, pev->origin );
SetThink( HuntThink );
SetTouch( BounceTouch );
SetThink( &HuntThink );
SetTouch( &BounceTouch );
m_vecIdeal = Vector( 0, 0, 0 );
@ -1213,7 +1213,7 @@ void CControllerHeadBall :: HuntThink( void )
// 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)
{
ResetTouch();
SetTouch( NULL );
UTIL_Remove( this );
return;
}
@ -1257,7 +1257,7 @@ void CControllerHeadBall :: HuntThink( void )
m_flNextAttack = gpGlobals->time + 3.0;
SetThink( DieThink );
SetThink( &DieThink );
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_SetOrigin( pev, pev->origin );
SetThink( AnimateThink );
SetTouch( ExplodeTouch );
SetThink( &AnimateThink );
SetTouch( &ExplodeTouch );
m_hOwner = Instance( pev->owner );
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)
{
ResetTouch();
SetTouch( NULL );
UTIL_Remove( this );
}
}

12
dlls/crossbow.cpp

@ -71,8 +71,8 @@ void CCrossbowBolt::Spawn( )
UTIL_SetOrigin( pev, pev->origin );
UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0));
SetTouch( BoltTouch );
SetThink( BubbleThink );
SetTouch( &BoltTouch );
SetThink( &BubbleThink );
pev->nextthink = gpGlobals->time + 0.2;
}
@ -96,8 +96,8 @@ int CCrossbowBolt :: Classify ( void )
void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
{
ResetTouch();
ResetThink();
SetTouch( NULL );
SetThink( NULL );
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));
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.
if ( FClassnameIs( pOther->pev, "worldspawn" ) )
@ -179,7 +179,7 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
if ( g_pGameRules->IsMultiplayer() )
{
SetThink( ExplodeThink );
SetThink( &ExplodeThink );
pev->nextthink = gpGlobals->time + 0.1;
}
}

4
dlls/crowbar.cpp

@ -147,7 +147,7 @@ void CCrowbar::PrimaryAttack()
{
if (! Swing( 1 ))
{
SetThink( SwingAgain );
SetThink( &SwingAgain );
pev->nextthink = gpGlobals->time + 0.1;
}
}
@ -306,7 +306,7 @@ int CCrowbar::Swing( int fFirst )
#endif
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25;
SetThink( Smack );
SetThink( &Smack );
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 ( FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) )
{
ResetTouch();
SetTouch( NULL );
}
else // touchable button
SetTouch( DoorTouch );
SetTouch( &DoorTouch );
}
@ -509,7 +509,7 @@ void CBaseDoor::DoorTouch( CBaseEntity *pOther )
m_hActivator = pOther;// remember who activated the door
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;
SetMoveDone( DoorHitTop );
SetMoveDone( &DoorHitTop );
if ( FClassnameIs(pev, "func_door_rotating")) // !!! BUGBUG Triggered doors don't work with this yet
{
float sign = 1.0;
@ -625,13 +625,13 @@ void CBaseDoor::DoorHitTop( void )
{
// Re-instate touch method, movement is complete
if ( !FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) )
SetTouch( DoorTouch );
SetTouch( &DoorTouch );
}
else
{
// In flWait seconds, DoorGoDown will fire, unless wait is -1, then door stays open
pev->nextthink = pev->ltime + m_flWait;
SetThink( DoorGoDown );
SetThink( &DoorGoDown );
if ( m_flWait == -1 )
{
@ -661,7 +661,7 @@ void CBaseDoor::DoorGoDown( void )
#endif // DOOR_ASSERT
m_toggle_state = TS_GOING_DOWN;
SetMoveDone( DoorHitBottom );
SetMoveDone( &DoorHitBottom );
if ( FClassnameIs(pev, "func_door_rotating"))//rotating door
AngularMove( m_vecAngle1, pev->speed);
else
@ -685,10 +685,10 @@ void CBaseDoor::DoorHitBottom( void )
// Re-instate touch method, cycle is complete
if ( FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) )
{// use only door
ResetTouch();
SetTouch( NULL );
}
else // touchable door
SetTouch( DoorTouch );
SetTouch( &DoorTouch );
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 ) )
{
ResetTouch();
SetTouch( NULL );
}
else // touchable button
SetTouch( DoorTouch );
SetTouch( &DoorTouch );
}
@ -935,7 +935,7 @@ void CMomentaryDoor::Spawn( void )
m_vecPosition2 = m_vecPosition1;
m_vecPosition1 = pev->origin;
}
ResetTouch();
SetTouch( NULL );
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);
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) )
{
SetThink( FizzThink );
SetThink( &FizzThink );
pev->nextthink = gpGlobals->time + 2.0;
m_state = 1;
}
@ -108,12 +108,12 @@ void CBubbling::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
if ( m_state )
{
SetThink( FizzThink );
SetThink( &FizzThink );
pev->nextthink = gpGlobals->time + 0.1;
}
else
{
ResetThink();
SetThink( NULL );
pev->nextthink = 0;
}
}
@ -427,7 +427,7 @@ LINK_ENTITY_TO_CLASS( trip_beam, CTripBeam );
void CTripBeam::Spawn( void )
{
CLightning::Spawn();
SetTouch( TriggerTouch );
SetTouch( &TriggerTouch );
pev->solid = SOLID_TRIGGER;
RelinkBeam();
}
@ -459,7 +459,7 @@ void CLightning::Spawn( void )
{
if ( FStringNull( m_iszSpriteName ) )
{
SetThink( SUB_Remove );
SetThink( &SUB_Remove );
return;
}
pev->solid = SOLID_NOT; // Remove model & collisions
@ -469,10 +469,10 @@ void CLightning::Spawn( void )
if ( ServerSide() )
{
ResetThink();
SetThink( NULL );
if ( pev->dmg > 0 )
{
SetThink( DamageThink );
SetThink( &DamageThink );
pev->nextthink = gpGlobals->time + 0.1;
}
if ( pev->targetname )
@ -486,7 +486,7 @@ void CLightning::Spawn( void )
else
m_active = 1;
SetUse( ToggleUse );
SetUse( &ToggleUse );
}
}
else
@ -494,11 +494,11 @@ void CLightning::Spawn( void )
m_active = 0;
if ( !FStringNull(pev->targetname) )
{
SetUse( StrikeUse );
SetUse( &StrikeUse );
}
if ( FStringNull(pev->targetname) || FBitSet(pev->spawnflags, SF_BEAM_STARTON) )
{
SetThink( StrikeThink );
SetThink( &StrikeThink );
pev->nextthink = gpGlobals->time + 1.0;
}
}
@ -612,16 +612,16 @@ void CLightning::StrikeUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
if ( m_active )
{
m_active = 0;
ResetThink();
SetThink( NULL );
}
else
{
SetThink( StrikeThink );
SetThink( &StrikeThink );
pev->nextthink = gpGlobals->time + 0.1;
}
if ( !FBitSet( pev->spawnflags, SF_BEAM_TOGGLE ) )
ResetUse();
SetUse( NULL );
}
@ -961,13 +961,13 @@ void CLaser::Spawn( void )
{
if ( FStringNull( pev->model ) )
{
SetThink( SUB_Remove );
SetThink( &SUB_Remove );
return;
}
pev->solid = SOLID_NOT; // Remove model & collisions
Precache( );
SetThink( StrikeThink );
SetThink( &StrikeThink );
pev->flags |= FL_CUSTOMENTITY;
PointsInit( pev->origin, pev->origin );
@ -1264,7 +1264,7 @@ void CSprite::Expand( float scaleSpeed, float fadeSpeed )
{
pev->speed = scaleSpeed;
pev->health = fadeSpeed;
SetThink( ExpandThink );
SetThink( &ExpandThink );
pev->nextthink = gpGlobals->time;
m_lastTime = gpGlobals->time;
@ -1319,7 +1319,7 @@ void CSprite::TurnOn( void )
pev->effects = 0;
if ( (pev->framerate && m_maxFrame > 1.0) || (pev->spawnflags & SF_SPRITE_ONCE) )
{
SetThink( AnimateThink );
SetThink( &AnimateThink );
pev->nextthink = 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 )
{
SetThink( ShootThink );
SetThink( &ShootThink );
pev->nextthink = gpGlobals->time;
}
@ -1511,12 +1511,12 @@ void CGibShooter :: ShootThink ( void )
if ( pev->spawnflags & SF_GIBSHOOTER_REPEATABLE )
{
m_iGibs = m_iGibCapacity;
ResetThink();
SetThink( NULL );
pev->nextthink = gpGlobals->time;
}
else
{
SetThink ( SUB_Remove );
SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time;
}
}
@ -1701,14 +1701,14 @@ void CTestEffect::TestThink( void )
m_flStartTime = gpGlobals->time;
m_iBeam = 0;
// pev->nextthink = gpGlobals->time;
ResetThink();
SetThink( NULL );
}
}
void CTestEffect::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
SetThink( TestThink );
SetThink( &TestThink );
pev->nextthink = gpGlobals->time + 0.1;
m_flStartTime = gpGlobals->time;
}
@ -2129,7 +2129,7 @@ void CEnvFunnel::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us
MESSAGE_END();
SetThink( SUB_Remove );
SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time;
}
@ -2184,7 +2184,7 @@ void CEnvBeverage::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
pev->frags = 1;
pev->health--;
//SetThink (SUB_Remove);
//SetThink( &SUB_Remove);
//pev->nextthink = gpGlobals->time;
}
@ -2228,7 +2228,7 @@ void CItemSoda::Spawn( void )
SET_MODEL ( ENT(pev), "models/can.mdl" );
UTIL_SetSize ( pev, Vector ( 0, 0, 0 ), Vector ( 0, 0, 0 ) );
SetThink (CanThink);
SetThink( &CanThink);
pev->nextthink = gpGlobals->time + 0.5;
}
@ -2238,8 +2238,8 @@ void CItemSoda::CanThink ( void )
pev->solid = SOLID_TRIGGER;
UTIL_SetSize ( pev, Vector ( -8, -8, 0 ), Vector ( 8, 8, 8 ) );
ResetThink();
SetTouch ( CanTouch );
SetThink( NULL );
SetTouch( &CanTouch );
}
void CItemSoda::CanTouch ( CBaseEntity *pOther )
@ -2262,7 +2262,7 @@ void CItemSoda::CanTouch ( CBaseEntity *pOther )
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
pev->effects = EF_NODRAW;
ResetTouch();
SetThink ( SUB_Remove );
SetTouch( NULL );
SetThink( &SUB_Remove );
pev->nextthink = gpGlobals->time;
}

4
dlls/effects.h

@ -79,7 +79,7 @@ public:
inline void AnimateAndDie( float framerate )
{
SetThink(AnimateUntilDead);
SetThink( &AnimateUntilDead);
pev->framerate = framerate;
pev->dmgtime = gpGlobals->time + (m_maxFrame / framerate);
pev->nextthink = gpGlobals->time;
@ -168,7 +168,7 @@ public:
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 )
{
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 );
}
SetThink( Smoke );
SetThink( &Smoke );
pev->nextthink = gpGlobals->time + 0.3;
// 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.
SetTouch( BreakTouch );
SetTouch( &BreakTouch );
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
if ( !IsBreakable() && pev->rendermode != kRenderNormal )
@ -445,7 +445,7 @@ void CBreakable::BreakTouch( CBaseEntity *pOther )
if (flDamage >= pev->health)
{
ResetTouch();
SetTouch( NULL );
TakeDamage(pevToucher, pevToucher, flDamage, DMG_CRUSH);
// 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.
DamageSound();
SetThink ( Die );
ResetTouch();