From 81207e381599dad89747bb11411bedcfa485220a Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 2 Mar 2016 11:39:18 +0000 Subject: [PATCH] Add sed script and convert all SetXXX macros --- .gitigonre | 4 ++- dlls/AI_BaseNPC_Schedule.cpp | 2 +- dlls/aflock.cpp | 18 +++++----- dlls/airtank.cpp | 4 +-- dlls/apache.cpp | 26 +++++++------- dlls/barnacle.cpp | 6 ++-- dlls/barney.cpp | 4 +-- dlls/bigmomma.cpp | 2 +- dlls/bmodels.cpp | 36 +++++++++---------- dlls/bullsquid.cpp | 4 +-- dlls/buttons.cpp | 70 ++++++++++++++++++------------------ dlls/cbase.h | 10 +++--- dlls/combat.cpp | 20 +++++------ dlls/controller.cpp | 14 ++++---- dlls/crossbow.cpp | 12 +++---- dlls/crowbar.cpp | 4 +-- dlls/doors.cpp | 26 +++++++------- dlls/effects.cpp | 58 +++++++++++++++--------------- dlls/effects.h | 4 +-- dlls/explode.cpp | 2 +- dlls/func_break.cpp | 14 ++++---- dlls/gargantua.cpp | 8 ++--- dlls/ggrenade.cpp | 22 ++++++------ dlls/h_battery.cpp | 8 ++--- dlls/h_cine.cpp | 10 +++--- dlls/h_cycler.cpp | 2 +- dlls/handgrenade.cpp | 2 +- dlls/headcrab.cpp | 6 ++-- dlls/healthkit.cpp | 8 ++--- dlls/hgrunt.cpp | 4 +-- dlls/hornet.cpp | 18 +++++----- dlls/hornetgun.cpp | 2 +- dlls/ichthyosaur.cpp | 4 +-- dlls/items.cpp | 10 +++--- dlls/leech.cpp | 10 +++--- dlls/monstermaker.cpp | 18 +++++----- dlls/monsters.cpp | 10 +++--- dlls/mortar.cpp | 6 ++-- dlls/mpstubb.cpp | 4 +-- dlls/nihilanth.cpp | 38 ++++++++++---------- dlls/nodes.cpp | 12 +++---- dlls/osprey.cpp | 20 +++++------ dlls/pathcorner.cpp | 2 +- dlls/plats.cpp | 62 ++++++++++++++++---------------- dlls/player.cpp | 16 ++++----- dlls/prop.cpp | 24 ++++++------- dlls/replace.sh | 5 +++ dlls/rpg.cpp | 12 +++---- dlls/satchel.cpp | 8 ++--- dlls/schedule.cpp | 2 +- dlls/scientist.cpp | 6 ++-- dlls/scripted.cpp | 28 +++++++-------- dlls/sound.cpp | 12 +++---- dlls/squeakgrenade.cpp | 12 +++---- dlls/subs.cpp | 6 ++-- dlls/talkmonster.cpp | 2 +- dlls/tentacle.cpp | 14 ++++---- dlls/triggers.cpp | 66 +++++++++++++++++----------------- dlls/tripmine.cpp | 16 ++++----- dlls/turret.cpp | 58 +++++++++++++++--------------- dlls/weapons.cpp | 48 ++++++++++++------------- dlls/world.cpp | 10 +++--- 62 files changed, 489 insertions(+), 482 deletions(-) create mode 100644 dlls/replace.sh diff --git a/.gitigonre b/.gitigonre index 543ea558..e01e183d 100644 --- a/.gitigonre +++ b/.gitigonre @@ -1,6 +1,8 @@ # Binaries *.o *.so +*/*.o +*/*/*.o *.a *.framework - +*.exe \ No newline at end of file diff --git a/dlls/AI_BaseNPC_Schedule.cpp b/dlls/AI_BaseNPC_Schedule.cpp index 75886699..f1eb367d 100644 --- a/dlls/AI_BaseNPC_Schedule.cpp +++ b/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() ) diff --git a/dlls/aflock.cpp b/dlls/aflock.cpp index 45824287..f536b4f0 100644 --- a/dlls/aflock.cpp +++ b/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; } diff --git a/dlls/airtank.cpp b/dlls/airtank.cpp index a356744b..b244f581 100644 --- a/dlls/airtank.cpp +++ b/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; diff --git a/dlls/apache.cpp b/dlls/apache.cpp index 233599f4..fae0ff34 100644 --- a/dlls/apache.cpp +++ b/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; } diff --git a/dlls/barnacle.cpp b/dlls/barnacle.cpp index 4042d7da..aaf8c539 100644 --- a/dlls/barnacle.cpp +++ b/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 ); } } diff --git a/dlls/barney.cpp b/dlls/barney.cpp index 1d3e23ad..7837c5c0 100644 --- a/dlls/barney.cpp +++ b/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 ); } diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index ca7a1bf8..06f98da1 100644 --- a/dlls/bigmomma.cpp +++ b/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; diff --git a/dlls/bmodels.cpp b/dlls/bmodels.cpp index 1386c242..1ab8afc7 100644 --- a/dlls/bmodels.cpp +++ b/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 ) diff --git a/dlls/bullsquid.cpp b/dlls/bullsquid.cpp index c8518b62..6a1ffe19 100644 --- a/dlls/bullsquid.cpp +++ b/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; } diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 5153d7ba..44f413bc 100644 --- a/dlls/buttons.cpp +++ b/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 diff --git a/dlls/cbase.h b/dlls/cbase.h index 1381c88a..1aa64bb3 100644 --- a/dlls/cbase.h +++ b/dlls/cbase.h @@ -373,10 +373,10 @@ public: #else -#define SetThink( a ) m_pfnThink = static_cast (&a) -#define SetTouch( a ) m_pfnTouch = static_cast (&a) -#define SetUse( a ) m_pfnUse = static_cast (&a) -#define SetBlocked( a ) m_pfnBlocked = static_cast (&a) +#define SetThink( a ) m_pfnThink = static_cast (a) +#define SetTouch( a ) m_pfnTouch = static_cast (a) +#define SetUse( a ) m_pfnUse = static_cast (a) +#define SetBlocked( a ) m_pfnBlocked = static_cast (a) #define ResetThink( ) m_pfnThink = static_cast (NULL) #define ResetTouch( ) m_pfnTouch = static_cast (NULL) #define ResetUse( ) m_pfnUse = static_cast (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 (&a) +#define SetMoveDone( a ) m_pfnCallWhenMoveDone = static_cast (a) diff --git a/dlls/combat.cpp b/dlls/combat.cpp index c99330cd..2899d051 100644 --- a/dlls/combat.cpp +++ b/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). diff --git a/dlls/controller.cpp b/dlls/controller.cpp index bad72429..0ade7ace 100644 --- a/dlls/controller.cpp +++ b/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 ); } } diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index 4a2ffd66..2a9224cd 100644 --- a/dlls/crossbow.cpp +++ b/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; } } diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index f301de7f..de6ad845 100644 --- a/dlls/crowbar.cpp +++ b/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; diff --git a/dlls/doors.cpp b/dlls/doors.cpp index d8233d9b..44815efb 100644 --- a/dlls/doors.cpp +++ b/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 ); } } diff --git a/dlls/effects.cpp b/dlls/effects.cpp index 36b49c33..933e952e 100644 --- a/dlls/effects.cpp +++ b/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; } \ No newline at end of file diff --git a/dlls/effects.h b/dlls/effects.h index 1464d6a6..c62a3ee4 100644 --- a/dlls/effects.h +++ b/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; diff --git a/dlls/explode.cpp b/dlls/explode.cpp index 55dcb1c9..2427d108 100644 --- a/dlls/explode.cpp +++ b/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 diff --git a/dlls/func_break.cpp b/dlls/func_break.cpp index 4a1d20d6..b1cad808 100644 --- a/dlls/func_break.cpp +++ b/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(); + SetThink( &Die ); + SetTouch( NULL ); if ( m_flDelay == 0 ) {// !!!BUGBUG - why doesn't zero delay work? @@ -743,7 +743,7 @@ void CBreakable::Die( void ) // Fire targets on break SUB_UseTargets( NULL, USE_TOGGLE, 0 ); - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); pev->nextthink = pev->ltime + 0.1; if ( m_iszSpawnObject ) 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); EMIT_SOUND(ENT(pev), CHAN_WEAPON, m_soundNames[m_lastSound], 0.5, ATTN_NORM); - // SetThink( StopSound ); + // SetThink( &StopSound ); // pev->nextthink = pev->ltime + 0.1; } else diff --git a/dlls/gargantua.cpp b/dlls/gargantua.cpp index c448d9e8..ffe60c6b 100644 --- a/dlls/gargantua.cpp +++ b/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->AnimateAndDie( RANDOM_FLOAT( 8.0, 12.0 ) ); pSprite->pev->nextthink = gpGlobals->time + 0.3; - pSprite->SetThink( SUB_Remove ); + pSprite->SetThink( &SUB_Remove ); pSprite->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxFadeFast ); } } @@ -1126,7 +1126,7 @@ void CGargantua::RunTask( Task_t *pTask ) pev->rendercolor.z = 0; StopAnimation(); pev->nextthink = gpGlobals->time + 0.15; - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); int i; int parts = MODEL_FRAMES( gGargGibModel ); for ( i = 0; i < 10; i++ ) @@ -1145,7 +1145,7 @@ void CGargantua::RunTask( Task_t *pTask ) pGib->pev->origin = pev->origin; pGib->pev->velocity = UTIL_RandomBloodVector() * RANDOM_FLOAT( 300, 500 ); pGib->pev->nextthink = gpGlobals->time + 1.25; - pGib->SetThink( SUB_FadeOut ); + pGib->SetThink( &SUB_FadeOut ); } MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); 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->Spawn(); - pExplosion->SetThink( CBaseEntity::SUB_CallUseToggle ); + pExplosion->SetThink( &CBaseEntity::SUB_CallUseToggle ); pExplosion->pev->nextthink = gpGlobals->time + time; } diff --git a/dlls/ggrenade.cpp b/dlls/ggrenade.cpp index bed91293..c811207b 100644 --- a/dlls/ggrenade.cpp +++ b/dlls/ggrenade.cpp @@ -113,7 +113,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) } pev->effects |= EF_NODRAW; - SetThink( Smoke ); + SetThink( &Smoke ); pev->velocity = g_vecZero; 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. void CGrenade::DetonateUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { - SetThink( Detonate ); + SetThink( &Detonate ); pev->nextthink = gpGlobals->time; } @@ -164,7 +164,7 @@ void CGrenade::PreDetonate( void ) { CSoundEnt::InsertSound ( bits_SOUND_DANGER, pev->origin, 400, 0.3 ); - SetThink( Detonate ); + SetThink( &Detonate ); pev->nextthink = gpGlobals->time + 1; } @@ -331,7 +331,7 @@ void CGrenade :: TumbleThink( void ) if (pev->dmgtime <= gpGlobals->time) { - SetThink( Detonate ); + SetThink( &Detonate ); } if (pev->waterlevel != 0) { @@ -368,14 +368,14 @@ CGrenade *CGrenade::ShootContact( entvars_t *pevOwner, Vector vecStart, Vector v pGrenade->pev->owner = ENT(pevOwner); // make monsters afaid of it while in the air - pGrenade->SetThink( DangerSoundThink ); + pGrenade->SetThink( &DangerSoundThink ); pGrenade->pev->nextthink = gpGlobals->time; // Tumble in air pGrenade->pev->avelocity.x = RANDOM_FLOAT ( -100, -500 ); // Explode on contact - pGrenade->SetTouch( ExplodeTouch ); + pGrenade->SetTouch( &ExplodeTouch ); 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->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 // 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(). pGrenade->pev->dmgtime = gpGlobals->time + time; - pGrenade->SetThink( TumbleThink ); + pGrenade->SetThink( &TumbleThink ); pGrenade->pev->nextthink = gpGlobals->time + 0.1; if (time < 0.1) { @@ -442,9 +442,9 @@ CGrenade * CGrenade :: ShootSatchelCharge( entvars_t *pevOwner, Vector vecStart, pGrenade->pev->owner = ENT(pevOwner); // Detonate in "time" seconds - pGrenade->SetThink( SUB_DoNothing ); - pGrenade->SetUse( DetonateUse ); - pGrenade->SetTouch( SlideTouch ); + pGrenade->SetThink( &SUB_DoNothing ); + pGrenade->SetUse( &DetonateUse ); + pGrenade->SetTouch( &SlideTouch ); pGrenade->pev->spawnflags = SF_DETONATE; pGrenade->pev->friction = 0.9; diff --git a/dlls/h_battery.cpp b/dlls/h_battery.cpp index 3f2a9a29..68c97bd1 100644 --- a/dlls/h_battery.cpp +++ b/dlls/h_battery.cpp @@ -129,7 +129,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use } pev->nextthink = pev->ltime + 0.25; - SetThink(Off); + SetThink( &Off); // Time to recharge yet? @@ -179,7 +179,7 @@ void CRecharge::Recharge(void) { m_iJuice = gSkillData.suitchargerCapacity; pev->frame = 0; - SetThink( SUB_DoNothing ); + SetThink( &SUB_DoNothing ); } void CRecharge::Off(void) @@ -193,8 +193,8 @@ void CRecharge::Off(void) if ((!m_iJuice) && ( ( m_iReactivate = g_pGameRules->FlHEVChargerRechargeTime() ) > 0) ) { pev->nextthink = pev->ltime + m_iReactivate; - SetThink(Recharge); + SetThink( &Recharge); } else - SetThink( SUB_DoNothing ); + SetThink( &SUB_DoNothing ); } \ No newline at end of file diff --git a/dlls/h_cine.cpp b/dlls/h_cine.cpp index 7f681922..def27354 100644 --- a/dlls/h_cine.cpp +++ b/dlls/h_cine.cpp @@ -124,7 +124,7 @@ void CLegacyCineMonster :: CineSpawn( char *szModel ) // if no targetname, start now if ( FStringNull(pev->targetname) ) { - SetThink( CineThink ); + SetThink( &CineThink ); 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 ) { pev->animtime = 0; // reset the sequence - SetThink( CineThink ); + SetThink( &CineThink ); pev->nextthink = gpGlobals->time; } @@ -145,7 +145,7 @@ void CLegacyCineMonster :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, U // 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 ) { - SetThink( BloodGush ); + SetThink( &BloodGush ); pev->nextthink = gpGlobals->time;// now! } void CCineBlood :: Spawn ( void ) { pev->solid = SOLID_NOT; - SetUse ( BloodStart ); + SetUse( &BloodStart ); pev->health = 20;//hacked health to count iterations } diff --git a/dlls/h_cycler.cpp b/dlls/h_cycler.cpp index a306359f..d823488e 100644 --- a/dlls/h_cycler.cpp +++ b/dlls/h_cycler.cpp @@ -334,7 +334,7 @@ void CWeaponCycler::Spawn( ) UTIL_SetOrigin( pev, pev->origin ); UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16)); - SetTouch( DefaultTouch ); + SetTouch( &DefaultTouch ); } diff --git a/dlls/handgrenade.cpp b/dlls/handgrenade.cpp index 007ad662..2233b8a0 100644 --- a/dlls/handgrenade.cpp +++ b/dlls/handgrenade.cpp @@ -103,7 +103,7 @@ void CHandGrenade::Holster( int skiplocal /* = 0 */ ) { // no more grenades! m_pPlayer->pev->weapons &= ~(1<nextthink = gpGlobals->time + 0.1; } diff --git a/dlls/headcrab.cpp b/dlls/headcrab.cpp index 809281aa..6f43965c 100644 --- a/dlls/headcrab.cpp +++ b/dlls/headcrab.cpp @@ -324,7 +324,7 @@ void CHeadCrab :: RunTask ( Task_t *pTask ) if ( m_fSequenceFinished ) { TaskComplete(); - ResetTouch(); + SetTouch( NULL ); m_IdealActivity = ACT_IDLE; } break; @@ -360,7 +360,7 @@ void CHeadCrab :: LeapTouch ( CBaseEntity *pOther ) 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() ); m_IdealActivity = ACT_RANGE_ATTACK1; - SetTouch ( LeapTouch ); + SetTouch( &LeapTouch ); break; } default: diff --git a/dlls/healthkit.cpp b/dlls/healthkit.cpp index 73931f28..fbf1d982 100644 --- a/dlls/healthkit.cpp +++ b/dlls/healthkit.cpp @@ -207,7 +207,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u } pev->nextthink = pev->ltime + 0.25; - SetThink(Off); + SetThink( &Off); // 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 ); m_iJuice = gSkillData.healthchargerCapacity; pev->frame = 0; - SetThink( SUB_DoNothing ); + SetThink( &SUB_DoNothing ); } void CWallHealth::Off(void) @@ -257,8 +257,8 @@ void CWallHealth::Off(void) if ((!m_iJuice) && ( ( m_iReactivate = g_pGameRules->FlHealthChargerRechargeTime() ) > 0) ) { pev->nextthink = pev->ltime + m_iReactivate; - SetThink(Recharge); + SetThink( &Recharge); } else - SetThink( SUB_DoNothing ); + SetThink( &SUB_DoNothing ); } \ No newline at end of file diff --git a/dlls/hgrunt.cpp b/dlls/hgrunt.cpp index 0d2ca6c9..eab06752 100644 --- a/dlls/hgrunt.cpp +++ b/dlls/hgrunt.cpp @@ -2393,7 +2393,7 @@ void CHGruntRepel::Spawn( void ) Precache( ); pev->solid = SOLID_NOT; - SetUse( RepelUse ); + SetUse( &RepelUse ); } 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->SetFlags( BEAM_FSOLID ); 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; UTIL_Remove( this ); diff --git a/dlls/hornet.cpp b/dlls/hornet.cpp index f27b79c5..f11dfb7f 100644 --- a/dlls/hornet.cpp +++ b/dlls/hornet.cpp @@ -93,8 +93,8 @@ void CHornet :: Spawn( void ) SET_MODEL(ENT( pev ), "models/hornet.mdl"); UTIL_SetSize( pev, Vector( -4, -4, -4 ), Vector( 4, 4, 4 ) ); - SetTouch( DieTouch ); - SetThink( StartTrack ); + SetTouch( &DieTouch ); + SetThink( &StartTrack ); edict_t *pSoundEnt = pev->owner; if ( !pSoundEnt ) @@ -169,8 +169,8 @@ void CHornet :: StartTrack ( void ) { IgniteTrail(); - SetTouch( TrackTouch ); - SetThink( TrackTarget ); + SetTouch( &TrackTouch ); + SetThink( &TrackTarget ); pev->nextthink = gpGlobals->time + 0.1; } @@ -182,9 +182,9 @@ void CHornet :: StartDart ( void ) { IgniteTrail(); - SetTouch( DartTouch ); + SetTouch( &DartTouch ); - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); pev->nextthink = gpGlobals->time + 4; } @@ -256,8 +256,8 @@ void CHornet :: TrackTarget ( void ) if (gpGlobals->time > m_flStopAttack) { - ResetTouch(); - SetThink( SUB_Remove ); + SetTouch( NULL ); + SetThink( &SUB_Remove ); pev->nextthink = gpGlobals->time + 0.1; 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->solid = SOLID_NOT; - SetThink ( SUB_Remove ); + SetThink( &SUB_Remove ); pev->nextthink = gpGlobals->time + 1;// stick around long enough for the sound to finish! } diff --git a/dlls/hornetgun.cpp b/dlls/hornetgun.cpp index 76b48894..8eb58431 100644 --- a/dlls/hornetgun.cpp +++ b/dlls/hornetgun.cpp @@ -235,7 +235,7 @@ void CHgun::SecondaryAttack( void ) pHornet->pev->velocity = gpGlobals->v_forward * 1200; pHornet->pev->angles = UTIL_VecToAngles( pHornet->pev->velocity ); - pHornet->SetThink( CHornet::StartDart ); + pHornet->SetThink( &CHornet::StartDart ); m_flRechargeTime = gpGlobals->time + 0.5; #endif diff --git a/dlls/ichthyosaur.cpp b/dlls/ichthyosaur.cpp index b88abf15..fa62e613 100644 --- a/dlls/ichthyosaur.cpp +++ b/dlls/ichthyosaur.cpp @@ -494,8 +494,8 @@ void CIchthyosaur :: Spawn() MonsterInit(); - SetTouch( BiteTouch ); - SetUse( CombatUse ); + SetTouch( &BiteTouch ); + SetUse( &CombatUse ); m_idealDist = 384; m_flMinSpeed = 80; diff --git a/dlls/items.cpp b/dlls/items.cpp index b1200ee9..fe88a53e 100644 --- a/dlls/items.cpp +++ b/dlls/items.cpp @@ -93,7 +93,7 @@ void CItem::Spawn( void ) pev->solid = SOLID_TRIGGER; UTIL_SetOrigin( pev, pev->origin ); UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16)); - SetTouch(ItemTouch); + SetTouch( &ItemTouch); if (DROP_TO_FLOOR(ENT(pev)) == 0) { @@ -125,7 +125,7 @@ void CItem::ItemTouch( CBaseEntity *pOther ) if (MyTouch( pPlayer )) { SUB_UseTargets( pOther, USE_TOGGLE, 0 ); - ResetTouch(); + SetTouch( NULL ); // player grabbed the item. g_pGameRules->PlayerGotItem( pPlayer, this ); @@ -146,12 +146,12 @@ void CItem::ItemTouch( CBaseEntity *pOther ) CBaseEntity* CItem::Respawn( void ) { - ResetTouch(); + SetTouch( NULL ); pev->effects |= EF_NODRAW; UTIL_SetOrigin( pev, g_pGameRules->VecItemRespawnSpot( this ) );// blip to whereever you should respawn. - SetThink ( Materialize ); + SetThink( &Materialize ); pev->nextthink = g_pGameRules->FlItemRespawnTime( this ); return this; } @@ -166,7 +166,7 @@ void CItem::Materialize( void ) pev->effects |= EF_MUZZLEFLASH; } - SetTouch( ItemTouch ); + SetTouch( &ItemTouch ); } #define SF_SUIT_SHORTLOGON 0x0001 diff --git a/dlls/leech.cpp b/dlls/leech.cpp index 73e233e9..6c13e08d 100644 --- a/dlls/leech.cpp +++ b/dlls/leech.cpp @@ -196,9 +196,9 @@ void CLeech::Spawn( void ) m_flFieldOfView = -0.5; // 180 degree FOV m_flDistLook = 750; MonsterInit(); - SetThink( SwimThink ); - ResetUse(); - ResetTouch(); + SetThink( &SwimThink ); + SetUse( NULL ); + SetTouch( NULL ); pev->view_ofs = g_vecZero; m_flTurning = 0; @@ -426,7 +426,7 @@ void CLeech::DeadThink( void ) { if ( m_Activity == ACT_DIEFORWARD ) { - ResetThink(); + SetThink( NULL ); StopAnimation(); return; } @@ -717,7 +717,7 @@ void CLeech::Killed(entvars_t *pevAttacker, int iGib) pev->movetype = MOVETYPE_TOSS; pev->takedamage = DAMAGE_NO; - SetThink( DeadThink ); + SetThink( &DeadThink ); } diff --git a/dlls/monstermaker.cpp b/dlls/monstermaker.cpp index 1ee8b708..43513d0a 100644 --- a/dlls/monstermaker.cpp +++ b/dlls/monstermaker.cpp @@ -111,29 +111,29 @@ void CMonsterMaker :: Spawn( ) { 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 { - SetUse ( ToggleUse );// so can be turned on/off + SetUse( &ToggleUse );// so can be turned on/off } if ( FBitSet ( pev->spawnflags, SF_MONSTERMAKER_START_ON ) ) {// start making monsters as soon as monstermaker spawns m_fActive = TRUE; - SetThink ( MakerThink ); + SetThink( &MakerThink ); } else {// wait to be activated. m_fActive = FALSE; - SetThink ( SUB_DoNothing ); + SetThink( &SUB_DoNothing ); } } else {// no targetname, just start. pev->nextthink = gpGlobals->time + m_flDelay; m_fActive = TRUE; - SetThink ( MakerThink ); + SetThink( &MakerThink ); } if ( m_cNumMonsters == 1 ) @@ -229,8 +229,8 @@ void CMonsterMaker::MakeMonster( void ) if ( m_cNumMonsters == 0 ) { // Disable this forever. Don't kill it because it still gets death notices - ResetThink(); - ResetUse(); + SetThink( NULL ); + SetUse( NULL ); } } @@ -254,12 +254,12 @@ void CMonsterMaker :: ToggleUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, if ( m_fActive ) { m_fActive = FALSE; - ResetThink(); + SetThink( NULL ); } else { m_fActive = TRUE; - SetThink ( MakerThink ); + SetThink( &MakerThink ); } pev->nextthink = gpGlobals->time; diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 8c734de3..ad64189d 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -2044,9 +2044,9 @@ void CBaseMonster :: MonsterInit ( void ) // set eye position SetEyePosition(); - SetThink( MonsterInitThink ); + SetThink( &MonsterInitThink ); 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 // 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. if ( !FStringNull(pev->targetname) )// wait until triggered @@ -3259,7 +3259,7 @@ void CBaseMonster::CorpseFallThink( void ) { if ( pev->flags & FL_ONGROUND ) { - ResetThink(); + SetThink( NULL ); SetSequenceBox( ); UTIL_SetOrigin( pev, pev->origin );// link into world. @@ -3289,7 +3289,7 @@ void CBaseMonster :: MonsterInitDead( void ) // Setup health counters, etc. BecomeDead(); - SetThink( CorpseFallThink ); + SetThink( &CorpseFallThink ); pev->nextthink = gpGlobals->time + 0.5; } diff --git a/dlls/mortar.cpp b/dlls/mortar.cpp index e23d7b60..d1d64825 100644 --- a/dlls/mortar.cpp +++ b/dlls/mortar.cpp @@ -105,7 +105,7 @@ void CFuncMortarField :: Spawn( void ) SET_MODEL(ENT(pev), STRING(pev->model)); // set size and link into world pev->movetype = MOVETYPE_NONE; SetBits( pev->effects, EF_NODRAW ); - SetUse( FieldUse ); + SetUse( &FieldUse ); Precache(); } @@ -209,7 +209,7 @@ void CMortar::Spawn( ) pev->dmg = 200; - SetThink( MortarExplode ); + SetThink( &MortarExplode ); pev->nextthink = 0; Precache( ); @@ -300,7 +300,7 @@ void CMortar::MortarExplode( void ) } */ - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); pev->nextthink = gpGlobals->time + 0.1; #endif diff --git a/dlls/mpstubb.cpp b/dlls/mpstubb.cpp index 36d0ff94..bd5ee369 100644 --- a/dlls/mpstubb.cpp +++ b/dlls/mpstubb.cpp @@ -50,7 +50,7 @@ void CBaseMonster::CorpseFallThink( void ) { if ( pev->flags & FL_ONGROUND ) { - ResetThink(); + SetThink( NULL ); SetSequenceBox( ); UTIL_SetOrigin( pev, pev->origin );// link into world. @@ -79,7 +79,7 @@ void CBaseMonster :: MonsterInitDead( void ) // Setup health counters, etc. BecomeDead(); - SetThink( CorpseFallThink ); + SetThink( &CorpseFallThink ); pev->nextthink = gpGlobals->time + 0.5; } diff --git a/dlls/nihilanth.cpp b/dlls/nihilanth.cpp index b054e125..8e7859eb 100644 --- a/dlls/nihilanth.cpp +++ b/dlls/nihilanth.cpp @@ -300,7 +300,7 @@ void CNihilanth :: Spawn( void ) InitBoneControllers(); - SetThink( StartupThink ); + SetThink( &StartupThink ); pev->nextthink = gpGlobals->time + 0.1; 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 ) { - SetThink( HuntThink ); + SetThink( &HuntThink ); pev->nextthink = gpGlobals->time + 0.1; - SetUse( CommandUse ); + SetUse( &CommandUse ); } @@ -410,8 +410,8 @@ void CNihilanth::StartupThink( void ) } m_hRecharger = NULL; - SetThink( HuntThink); - SetUse( CommandUse ); + SetThink( &HuntThink); + SetUse( &CommandUse ); pev->nextthink = gpGlobals->time + 0.1; } @@ -544,7 +544,7 @@ void CNihilanth::CrashTouch( CBaseEntity *pOther ) // only crash if we hit something solid if ( pOther->pev->solid == SOLID_BSP) { - ResetTouch(); + SetTouch( NULL ); pev->nextthink = gpGlobals->time; } } @@ -846,7 +846,7 @@ void CNihilanth :: HuntThink( void ) // if dead, force cancelation of current animation if (pev->health <= 0) { - SetThink( DyingThink ); + SetThink( &DyingThink ); m_fSequenceFinished = TRUE; return; } @@ -1330,8 +1330,8 @@ void CNihilanthHVR :: CircleInit( CBaseEntity *pTarget ) UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0)); UTIL_SetOrigin( pev, pev->origin ); - SetThink( HoverThink ); - SetTouch( BounceTouch ); + SetThink( &HoverThink ); + SetTouch( &BounceTouch ); pev->nextthink = gpGlobals->time + 0.1; m_hTargetEnt = pTarget; @@ -1433,8 +1433,8 @@ void CNihilanthHVR :: ZapInit( CBaseEntity *pEnemy ) pev->velocity = (pEnemy->pev->origin - pev->origin).Normalize() * 200; m_hEnemy = pEnemy; - SetThink( ZapThink ); - SetTouch( ZapTouch ); + SetThink( &ZapThink ); + SetTouch( &ZapTouch ); pev->nextthink = gpGlobals->time + 0.1; 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 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 ); 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 ) ); - ResetTouch(); + SetTouch( NULL ); UTIL_Remove( this ); pev->nextthink = gpGlobals->time + 0.2; return; @@ -1535,7 +1535,7 @@ void CNihilanthHVR::ZapTouch( CBaseEntity *pOther ) } */ - ResetTouch(); + SetTouch( NULL ); UTIL_Remove( this ); pev->nextthink = gpGlobals->time + 0.2; } @@ -1559,8 +1559,8 @@ void CNihilanthHVR :: TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBa m_hTargetEnt = pTarget; m_hTouch = pTouch; - SetThink( TeleportThink ); - SetTouch( TeleportTouch ); + SetThink( &TeleportThink ); + SetTouch( &TeleportTouch ); pev->nextthink = gpGlobals->time + 0.1; 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"); - SetTouch( RemoveTouch ); + SetTouch( &RemoveTouch ); } @@ -1631,7 +1631,7 @@ void CNihilanthHVR :: TeleportThink( void ) void CNihilanthHVR :: AbsorbInit( void ) { - SetThink( DissipateThink ); + SetThink( &DissipateThink ); pev->renderamt = 255; MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -1669,7 +1669,7 @@ void CNihilanthHVR::TeleportTouch( CBaseEntity *pOther ) m_pNihilanth->MakeFriend( pev->origin ); } - ResetTouch(); + SetTouch( NULL ); STOP_SOUND(edict(), CHAN_WEAPON, "x/x_teleattack1.wav" ); UTIL_Remove( this ); } diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index c3f896ca..058260b3 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -1459,12 +1459,12 @@ void CTestHull :: Spawn( entvars_t *pevMasterNode ) if ( WorldGraph.m_fGraphPresent ) {// graph loaded from disk, so we don't need the test hull - SetThink ( SUB_Remove ); + SetThink( &SUB_Remove ); pev->nextthink = gpGlobals->time; } else { - SetThink ( DropDelay ); + SetThink( &DropDelay ); pev->nextthink = gpGlobals->time + 1; } @@ -1484,7 +1484,7 @@ void CTestHull::DropDelay ( void ) UTIL_SetOrigin ( VARS(pev), WorldGraph.m_pNodes[ 0 ].m_vecOrigin ); - SetThink ( CallBuildNodeGraph ); + SetThink( &CallBuildNodeGraph ); pev->nextthink = gpGlobals->time + 1; } @@ -1632,7 +1632,7 @@ void CTestHull :: BuildNodeGraph( void ) float flDist; 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; // 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" ); - 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->origin = WorldGraph.m_pNodes[ iBadNode ].m_vecOrigin; @@ -3559,7 +3559,7 @@ void CNodeViewer::Spawn( ) ALERT( at_aiconsole, "%d nodes\n", m_nVisited ); m_iDraw = 0; - SetThink( DrawThink ); + SetThink( &DrawThink ); pev->nextthink = gpGlobals->time; } diff --git a/dlls/osprey.cpp b/dlls/osprey.cpp index 6dc263d3..b85fadda 100644 --- a/dlls/osprey.cpp +++ b/dlls/osprey.cpp @@ -167,8 +167,8 @@ void COsprey :: Spawn( void ) InitBoneControllers(); - SetThink( FindAllThink ); - SetUse( CommandUse ); + SetThink( &FindAllThink ); + SetUse( &CommandUse ); if (!(pev->spawnflags & SF_WAITFORTRIGGER)) { @@ -225,7 +225,7 @@ void COsprey :: FindAllThink( void ) UTIL_Remove( this ); return; } - SetThink( FlyThink ); + SetThink( &FlyThink ); pev->nextthink = gpGlobals->time + 0.1; m_startTime = gpGlobals->time; } @@ -257,7 +257,7 @@ void COsprey :: DeployThink( void ) vecSrc = pev->origin + vecForward * -64 + vecRight * -100 + vecUp * -96; m_hRepel[3] = MakeGrunt( vecSrc ); - SetThink( HoverThink ); + SetThink( &HoverThink ); 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->SetFlags( BEAM_FSOLID ); 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; // 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) { m_startTime = gpGlobals->time; - SetThink( FlyThink ); + SetThink( &FlyThink ); } pev->nextthink = gpGlobals->time + 0.1; @@ -396,7 +396,7 @@ void COsprey::FlyThink( void ) { if (m_pGoalEnt->pev->speed == 0) { - SetThink( DeployThink ); + SetThink( &DeployThink ); } do { 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" ); 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; @@ -532,7 +532,7 @@ void COsprey::CrashTouch( CBaseEntity *pOther ) // only crash if we hit something solid if ( pOther->pev->solid == SOLID_BSP) { - ResetTouch(); + SetTouch( NULL ); m_startTime = gpGlobals->time; pev->nextthink = gpGlobals->time; m_velocity = pev->velocity; diff --git a/dlls/pathcorner.cpp b/dlls/pathcorner.cpp index b7216720..498550de 100644 --- a/dlls/pathcorner.cpp +++ b/dlls/pathcorner.cpp @@ -221,7 +221,7 @@ void CPathTrack :: Spawn( void ) m_pprevious = NULL; // DEBUGGING CODE #if PATH_SPARKLE_DEBUG - SetThink( Sparkle ); + SetThink( &Sparkle ); pev->nextthink = gpGlobals->time + 0.5; #endif } diff --git a/dlls/plats.cpp b/dlls/plats.cpp index 418f64e9..5b62d79b 100644 --- a/dlls/plats.cpp +++ b/dlls/plats.cpp @@ -328,7 +328,7 @@ void CFuncPlat :: Spawn( ) { UTIL_SetOrigin (pev, m_vecPosition1); m_toggle_state = TS_AT_TOP; - SetUse( PlatUse ); + SetUse( &PlatUse ); } else { @@ -417,7 +417,7 @@ void CFuncPlat :: PlatUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY } else { - ResetUse(); + SetUse( NULL ); if (m_toggle_state == TS_AT_TOP) GoDown(); @@ -435,7 +435,7 @@ void CFuncPlat :: GoDown( void ) ASSERT(m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP); m_toggle_state = TS_GOING_DOWN; - SetMoveDone(CallHitBottom); + SetMoveDone( &CallHitBottom); 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); m_toggle_state = TS_GOING_UP; - SetMoveDone(CallHitTop); + SetMoveDone( &CallHitTop); LinearMove(m_vecPosition1, pev->speed); } @@ -488,7 +488,7 @@ void CFuncPlat :: HitTop( void ) if ( !IsTogglePlat() ) { // After a delay, the platform will automatically start going down again. - SetThink( CallGoDown ); + SetThink( &CallGoDown ); pev->nextthink = pev->ltime + 3; } } @@ -738,7 +738,7 @@ void CFuncTrain :: Wait( void ) STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING(pev->noiseMovement) ); if ( pev->noiseStopMoving ) EMIT_SOUND (ENT(pev), CHAN_VOICE, (char*)STRING(pev->noiseStopMoving), m_volume, ATTN_NORM); - SetThink( Next ); + SetThink( &Next ); } else { @@ -802,7 +802,7 @@ void CFuncTrain :: Next( void ) if ( pev->noiseMovement ) EMIT_SOUND (ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseMovement), m_volume, ATTN_NORM); ClearBits(pev->effects, EF_NOINTERP); - SetMoveDone( Wait ); + SetMoveDone( &Wait ); LinearMove (pTarg->pev->origin - (pev->mins + pev->maxs)* 0.5, pev->speed); } } @@ -824,7 +824,7 @@ void CFuncTrain :: Activate( void ) if ( FStringNull(pev->targetname) ) { // not triggered, so start immediately pev->nextthink = pev->ltime + 0.1; - SetThink( Next ); + SetThink( &Next ); } else 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 { - SetThink( Next ); + SetThink( &Next ); pev->nextthink = pev->ltime + 0.1; } } @@ -1047,7 +1047,7 @@ void CFuncTrackTrain :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ pev->velocity = g_vecZero; pev->avelocity = g_vecZero; StopSound(); - ResetThink(); + SetThink( NULL ); } } else @@ -1262,7 +1262,7 @@ void CFuncTrackTrain :: Next( void ) } } - SetThink( Next ); + SetThink( &Next ); NextThink( pev->ltime + time, TRUE ); } else // end of path, stop @@ -1284,7 +1284,7 @@ void CFuncTrackTrain :: Next( void ) // no, how long to get there? time = distance / m_oldSpeed; pev->velocity = pev->velocity * (m_oldSpeed / distance); - SetThink( DeadEnd ); + SetThink( &DeadEnd ); NextThink( pev->ltime + time, FALSE ); } else @@ -1402,7 +1402,7 @@ void CFuncTrackTrain :: Find( void ) pev->angles.x = 0; UTIL_SetOrigin( pev, nextPos ); NextThink( pev->ltime + 0.1, FALSE ); - SetThink( Next ); + SetThink( &Next ); pev->speed = m_startSpeed; UpdateSound(); @@ -1434,7 +1434,7 @@ void CFuncTrackTrain :: NearestPath( void ) if ( !pNearest ) { ALERT( at_console, "Can't find a nearby track !!!\n" ); - ResetThink(); + SetThink( NULL ); return; } @@ -1452,7 +1452,7 @@ void CFuncTrackTrain :: NearestPath( void ) if ( pev->speed != 0 ) { NextThink( pev->ltime + 0.1, FALSE ); - SetThink( Next ); + SetThink( &Next ); } } @@ -1460,7 +1460,7 @@ void CFuncTrackTrain :: NearestPath( void ) void CFuncTrackTrain::OverrideReset( void ) { 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 // a chance to spawn/activate NextThink( pev->ltime + 0.1, FALSE ); - SetThink( Find ); + SetThink( &Find ); Precache(); } @@ -1589,7 +1589,7 @@ void CFuncTrainControls :: Spawn( void ) UTIL_SetSize( pev, pev->mins, pev->maxs ); UTIL_SetOrigin( pev, pev->origin ); - SetThink( Find ); + SetThink( &Find ); pev->nextthink = gpGlobals->time; } @@ -1701,7 +1701,7 @@ void CFuncTrackChange :: Spawn( void ) EnableUse(); pev->nextthink = pev->ltime + 2.0; - SetThink( Find ); + SetThink( &Find ); Precache(); } @@ -1752,7 +1752,7 @@ void CFuncTrackChange :: KeyValue( KeyValueData *pkvd ) void CFuncTrackChange::OverrideReset( void ) { pev->nextthink = pev->ltime + 1.0; - SetThink( Find ); + SetThink( &Find ); } void CFuncTrackChange :: Find( void ) @@ -1781,7 +1781,7 @@ void CFuncTrackChange :: Find( void ) m_trackBottom = m_trackBottom->Nearest( center ); m_trackTop = m_trackTop->Nearest( center ); UpdateAutoTargets( m_toggle_state ); - ResetThink(); + SetThink( NULL ); return; } else @@ -1862,14 +1862,14 @@ void CFuncTrackChange :: GoDown( void ) // If ROTMOVE, move & rotate if ( FBitSet( pev->spawnflags, SF_TRACK_DONT_MOVE ) ) { - SetMoveDone( CallHitBottom ); + SetMoveDone( &CallHitBottom ); m_toggle_state = TS_GOING_DOWN; AngularMove( m_start, pev->speed ); } else { CFuncPlat :: GoDown(); - SetMoveDone( CallHitBottom ); + SetMoveDone( &CallHitBottom ); RotMove( m_start, pev->nextthink - pev->ltime ); } // Otherwise, rotate first, move second @@ -1898,14 +1898,14 @@ void CFuncTrackChange :: GoUp( void ) if ( FBitSet( pev->spawnflags, SF_TRACK_DONT_MOVE ) ) { m_toggle_state = TS_GOING_UP; - SetMoveDone( CallHitTop ); + SetMoveDone( &CallHitTop ); AngularMove( m_end, pev->speed ); } else { // If ROTMOVE, move & rotate CFuncPlat :: GoUp(); - SetMoveDone( CallHitTop ); + SetMoveDone( &CallHitTop ); RotMove( m_end, pev->nextthink - pev->ltime ); } @@ -1980,7 +1980,7 @@ void CFuncTrackChange :: HitBottom( void ) // UpdateTrain(); m_train->SetTrack( m_trackBottom ); } - ResetThink(); + SetThink( NULL ); pev->nextthink = -1; UpdateAutoTargets( m_toggle_state ); @@ -2002,7 +2002,7 @@ void CFuncTrackChange :: HitTop( void ) } // Don't let the plat go back down - ResetThink(); + SetThink( NULL ); pev->nextthink = -1; UpdateAutoTargets( m_toggle_state ); EnableUse(); @@ -2160,7 +2160,7 @@ void CGunTarget::Spawn( void ) if ( pev->spawnflags & FGUNTARGET_START_ON ) { - SetThink( Start ); + SetThink( &Start ); pev->nextthink = pev->ltime + 0.3; } } @@ -2188,7 +2188,7 @@ void CGunTarget::Start( void ) void CGunTarget::Next( void ) { - ResetThink(); + SetThink( NULL ); m_hTargetEnt = GetNextTarget(); CBaseEntity *pTarget = m_hTargetEnt; @@ -2198,7 +2198,7 @@ void CGunTarget::Next( void ) Stop(); return; } - SetMoveDone( Wait ); + SetMoveDone( &Wait ); LinearMove( pTarget->pev->origin - (pev->mins + pev->maxs) * 0.5, pev->speed ); } @@ -2224,7 +2224,7 @@ void CGunTarget::Wait( void ) m_flWait = pTarget->GetDelay(); pev->target = pTarget->pev->target; - SetThink( Next ); + SetThink( &Next ); if (m_flWait != 0) {// -1 wait will wait forever! pev->nextthink = pev->ltime + m_flWait; diff --git a/dlls/player.cpp b/dlls/player.cpp index 3fc7d177..8ff7a395 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -774,7 +774,7 @@ void CBasePlayer::PackDeadPlayerItems( void ) pWeaponBox->pev->angles.x = 0;// don't let weaponbox tilt. pWeaponBox->pev->angles.z = 0; - pWeaponBox->SetThink( CWeaponBox::Kill ); + pWeaponBox->SetThink( &CWeaponBox::Kill ); pWeaponBox->pev->nextthink = gpGlobals->time + 120; // 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.z = 0; - SetThink(PlayerDeathThink); + SetThink( &PlayerDeathThink); pev->nextthink = gpGlobals->time + 0.1; } @@ -3209,7 +3209,7 @@ void CBloodSplat::Spawn ( entvars_t *pevOwner ) pev->angles = pevOwner->v_angle; pev->owner = ENT(pevOwner); - SetThink ( Spray ); + SetThink( &Spray ); pev->nextthink = gpGlobals->time + 0.1; } @@ -3224,7 +3224,7 @@ void CBloodSplat::Spray ( void ) UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED ); } - SetThink ( SUB_Remove ); + SetThink( &SUB_Remove ); pev->nextthink = gpGlobals->time + 0.1; } @@ -3587,7 +3587,7 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse ) if ( pEntity ) { if ( pEntity->pev->takedamage ) - pEntity->SetThink(SUB_Remove); + pEntity->SetThink( &SUB_Remove); } break; } @@ -3663,7 +3663,7 @@ int CBasePlayer::RemovePlayerItem( CBasePlayerItem *pItem ) ResetAutoaim( ); pItem->Holster( ); pItem->pev->nextthink = 0;// crowbar may be trying to swing again, etc. - pItem->ResetThink(); + pItem->SetThink( NULL ); m_pActiveItem = NULL; pev->viewmodel = 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 ); pev->nextthink = gpGlobals->time + MessageTime(); - SetThink( MessageThink ); + SetThink( &MessageThink ); } @@ -4737,7 +4737,7 @@ void CRevertSaved :: MessageThink( void ) if ( nextThink > 0 ) { pev->nextthink = gpGlobals->time + nextThink; - SetThink( LoadThink ); + SetThink( &LoadThink ); } else LoadThink(); diff --git a/dlls/prop.cpp b/dlls/prop.cpp index 3f4f0a98..56671736 100644 --- a/dlls/prop.cpp +++ b/dlls/prop.cpp @@ -566,7 +566,7 @@ void CProp::Killed(entvars_t *pevAttacker, int iGib) pev->solid = SOLID_NOT; pev->effects |= EF_NODRAW; pev->nextthink = gpGlobals->time + m_flRespawnTime; - SetThink( CProp::RespawnThink ); + SetThink( &CProp::RespawnThink ); ResetTouch( ); ResetUse( ); } @@ -605,7 +605,7 @@ void CProp::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, m_pHolstered->pev->weaponmodel = 0; m_pHolstered->pev->viewmodel = 0; } - SetThink( CProp::DeployThink ); + SetThink( &CProp::DeployThink ); 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; - SetThink(CProp::RespawnThink); + SetThink( &CProp::RespawnThink); } void CProp::CheckRotate() @@ -739,7 +739,7 @@ void CProp::DeployThink( void ) if( m_pfnThink == &CProp::DeployThink ) { pev->nextthink = gpGlobals->time + m_flRespawnTime; - SetThink( CProp::RespawnThink ); + SetThink( &CProp::RespawnThink ); } } @@ -899,8 +899,8 @@ void CProp::PropRespawn() m_oldshape = (PropShape)-1; CheckRotate(); pev->health = m_flSpawnHealth; - SetTouch(CProp::BounceTouch); - SetUse(CProp::Use); + SetTouch( &CProp::BounceTouch); + SetUse( &CProp::Use); pev->effects &= ~EF_NODRAW; pev->framerate = 1.0f; } @@ -917,7 +917,7 @@ void CProp::RespawnThink() void CProp::AngleThink() { pev->nextthink = gpGlobals->time + m_flRespawnTime; - SetThink(CProp::RespawnThink); + SetThink( &CProp::RespawnThink); if (!(pev->flags & FL_ONGROUND || fabs(pev->velocity.z) < 40)) { m_owner2 = m_attacker = 0; @@ -928,7 +928,7 @@ void CProp::AngleThink() pev->angles.z += UTIL_AngleDiff(90, pev->angles.z) * 0.7; if (fabs(UTIL_AngleDiff(90, pev->angles.z)) > 0.1) { - SetThink(CProp::AngleThink); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } //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) { - SetThink(CProp::AngleThink); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } 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.z, pev->angles.z)) > 0.1) { - SetThink(CProp::AngleThink); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } 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.z, pev->angles.z)) > 0.1) { - SetThink(CProp::AngleThink); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } 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 || fabs(UTIL_AngleDiff(ianglez, pev->angles.z)) > 0.1 ) { - SetThink(CProp::AngleThink); + SetThink( &CProp::AngleThink); pev->nextthink = gpGlobals->time + 0.1; } pev->angles.x += UTIL_AngleDiff(ianglex, pev->angles.x) * 0.6; diff --git a/dlls/replace.sh b/dlls/replace.sh new file mode 100644 index 00000000..90971faa --- /dev/null +++ b/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 diff --git a/dlls/rpg.cpp b/dlls/rpg.cpp index a14eaa3c..e13af4ab 100644 --- a/dlls/rpg.cpp +++ b/dlls/rpg.cpp @@ -80,7 +80,7 @@ void CLaserSpot::Suspend( float flSuspendTime ) { pev->effects |= EF_NODRAW; - SetThink( Revive ); + SetThink( &Revive ); pev->nextthink = gpGlobals->time + flSuspendTime; } @@ -91,7 +91,7 @@ void CLaserSpot::Revive( void ) { pev->effects &= ~EF_NODRAW; - ResetThink(); + SetThink( NULL ); } void CLaserSpot::Precache( void ) @@ -110,7 +110,7 @@ CRpgRocket *CRpgRocket::CreateRpgRocket( Vector vecOrigin, Vector vecAngles, CBa UTIL_SetOrigin( pRocket->pev, vecOrigin ); pRocket->pev->angles = vecAngles; pRocket->Spawn(); - pRocket->SetTouch( CRpgRocket::RocketTouch ); + pRocket->SetTouch( &CRpgRocket::RocketTouch ); pRocket->m_pLauncher = pLauncher;// remember what RPG fired me. pRocket->m_pLauncher->m_cActiveRockets++;// register this missile as active for the launcher pRocket->pev->owner = pOwner->edict(); @@ -133,8 +133,8 @@ void CRpgRocket :: Spawn( void ) pev->classname = MAKE_STRING("rpg_rocket"); - SetThink( IgniteThink ); - SetTouch( ExplodeTouch ); + SetThink( &IgniteThink ); + SetTouch( &ExplodeTouch ); pev->angles.x -= 30; UTIL_MakeVectors( pev->angles ); @@ -200,7 +200,7 @@ void CRpgRocket :: IgniteThink( void ) m_flIgniteTime = gpGlobals->time; // set to follow laser spot - SetThink( FollowThink ); + SetThink( &FollowThink ); pev->nextthink = gpGlobals->time + 0.1; } diff --git a/dlls/satchel.cpp b/dlls/satchel.cpp index 7c5ff451..0bd6513d 100644 --- a/dlls/satchel.cpp +++ b/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_SetOrigin( pev, pev->origin ); - SetTouch( SatchelSlide ); - SetUse( DetonateUse ); - SetThink( SatchelThink ); + SetTouch( &SatchelSlide ); + SetUse( &DetonateUse ); + SetThink( &SatchelThink ); pev->nextthink = gpGlobals->time + 0.1; pev->gravity = 0.5; @@ -322,7 +322,7 @@ void CSatchel::Holster( int skiplocal /* = 0 */ ) if ( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] && !m_chargeReady ) { m_pPlayer->pev->weapons &= ~(1<nextthink = gpGlobals->time + 0.1; } } diff --git a/dlls/schedule.cpp b/dlls/schedule.cpp index 75886699..f1eb367d 100644 --- a/dlls/schedule.cpp +++ b/dlls/schedule.cpp @@ -454,7 +454,7 @@ void CBaseMonster :: RunTask ( Task_t *pTask ) { pev->deadflag = DEAD_DEAD; - ResetThink(); + SetThink( NULL ); StopAnimation(); if ( !BBoxFlat() ) diff --git a/dlls/scientist.cpp b/dlls/scientist.cpp index b80623ff..5b1742b3 100644 --- a/dlls/scientist.cpp +++ b/dlls/scientist.cpp @@ -686,7 +686,7 @@ void CScientist :: Spawn( void ) pev->skin = 1; MonsterInit(); - SetUse( FollowerUse ); + SetUse( &FollowerUse ); } //========================================================= @@ -813,7 +813,7 @@ void CScientist :: DeathSound ( void ) void CScientist::Killed( entvars_t *pevAttacker, int iGib ) { - ResetUse(); + SetUse( NULL ); CTalkMonster::Killed( pevAttacker, iGib ); } @@ -1240,7 +1240,7 @@ void CSittingScientist :: Spawn( ) pev->sequence = m_baseSequence + RANDOM_LONG(0,4); ResetSequenceInfo( ); - SetThink (SittingThink); + SetThink( &SittingThink); pev->nextthink = gpGlobals->time + 0.1; DROP_TO_FLOOR ( ENT(pev) ); diff --git a/dlls/scripted.cpp b/dlls/scripted.cpp index 3767a508..817e1f79 100644 --- a/dlls/scripted.cpp +++ b/dlls/scripted.cpp @@ -142,7 +142,7 @@ void CCineMonster :: Spawn( void ) // if no targetname, start now if ( FStringNull(pev->targetname) || !FStringNull( m_iszIdle ) ) { - SetThink( CineThink ); + SetThink( &CineThink ); pev->nextthink = gpGlobals->time + 1.0; // Wait to be used? if ( pev->targetname ) @@ -198,7 +198,7 @@ void CCineMonster :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP else { // if not, try finding them - SetThink( CineThink ); + SetThink( &CineThink ); pev->nextthink = gpGlobals->time; } } @@ -253,7 +253,7 @@ void CCineMonster :: Touch( CBaseEntity *pOther ) // 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 ) ) { - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); pev->nextthink = gpGlobals->time + 0.1; } @@ -827,12 +827,12 @@ BOOL CBaseMonster :: CineCleanup( ) if ( pOldCine && FBitSet( pOldCine->pev->spawnflags, SF_SCRIPT_LEAVECORPSE ) ) { - ResetUse(); // BUGBUG -- This doesn't call Killed() - ResetThink(); // This will probably break some stuff - ResetTouch(); + SetUse( NULL ); // BUGBUG -- This doesn't call Killed() + SetThink( NULL ); // This will probably break some stuff + SetTouch( NULL ); } 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 StopAnimation(); pev->movetype = MOVETYPE_NONE; @@ -1026,7 +1026,7 @@ void CScriptedSentence :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, US if ( !m_active ) return; // ALERT( at_console, "Firing sentence: %s\n", STRING(m_iszSentence) ); - SetThink( FindThink ); + SetThink( &FindThink ); pev->nextthink = gpGlobals->time; } @@ -1039,7 +1039,7 @@ void CScriptedSentence :: Spawn( void ) // if no targetname, start now if ( !pev->targetname ) { - SetThink( FindThink ); + SetThink( &FindThink ); pev->nextthink = gpGlobals->time + 1.0; } @@ -1078,7 +1078,7 @@ void CScriptedSentence :: FindThink( void ) StartSentence( pMonster ); if ( pev->spawnflags & SF_SENTENCE_ONCE ) UTIL_Remove( this ); - SetThink( DelayThink ); + SetThink( &DelayThink ); pev->nextthink = gpGlobals->time + m_flDuration + m_flRepeat; m_active = FALSE; // 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; if ( !pev->targetname ) 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 ) { - SetThink ( SUB_Remove ); + SetThink( &SUB_Remove ); pev->nextthink = gpGlobals->time; } @@ -1242,7 +1242,7 @@ void CFurniture :: Spawn( ) pev->frame = 0; // pev->nextthink += 1.0; -// SetThink (WalkMonsterDelay); +// SetThink( &WalkMonsterDelay); ResetSequenceInfo( ); pev->frame = 0; diff --git a/dlls/sound.cpp b/dlls/sound.cpp index b02381e5..01038247 100644 --- a/dlls/sound.cpp +++ b/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 ); pev->nextthink = gpGlobals->time + 0.1; - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); return; } pev->solid = SOLID_NOT; @@ -203,12 +203,12 @@ void CAmbientGeneric :: Spawn( void ) // of ambient sound's pitch or volume. Don't // start thinking yet. - SetThink(RampThink); + SetThink( &RampThink); pev->nextthink = 0; // allow on/off switching via 'use' function. - SetUse ( ToggleUse ); + SetUse( &ToggleUse ); 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 ); pev->nextthink = gpGlobals->time + 0.1; - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); return; } pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; - SetThink(SpeakerThink); + SetThink( &SpeakerThink); pev->nextthink = 0.0; // allow on/off switching via 'use' function. - SetUse ( ToggleUse ); + SetUse( &ToggleUse ); Precache( ); } diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index b3b34edc..0eacb2d8 100644 --- a/dlls/squeakgrenade.cpp +++ b/dlls/squeakgrenade.cpp @@ -120,8 +120,8 @@ void CSqueakGrenade :: Spawn( void ) UTIL_SetSize(pev, Vector( -4, -4, 0), Vector(4, 4, 8)); UTIL_SetOrigin( pev, pev->origin ); - SetTouch( SuperBounceTouch ); - SetThink( HuntThink ); + SetTouch( &SuperBounceTouch ); + SetThink( &HuntThink ); pev->nextthink = gpGlobals->time + 0.1; m_flNextHunt = gpGlobals->time + 1E6; @@ -162,8 +162,8 @@ void CSqueakGrenade::Precache( void ) void CSqueakGrenade :: Killed( entvars_t *pevAttacker, int iGib ) { pev->model = iStringNull;// make invisible - SetThink( SUB_Remove ); - ResetTouch(); + SetThink( &SUB_Remove ); + SetTouch( NULL ); pev->nextthink = gpGlobals->time + 0.1; // since squeak grenades never leave a body behind, clear out their takedamage now. @@ -203,7 +203,7 @@ void CSqueakGrenade::HuntThink( void ) if (!IsInWorld()) { - ResetTouch(); + SetTouch( NULL ); UTIL_Remove( this ); return; } @@ -483,7 +483,7 @@ void CSqueak::Holster( int skiplocal /* = 0 */ ) if ( !m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] ) { m_pPlayer->pev->weapons &= ~(1<nextthink = gpGlobals->time + 0.1; return; } diff --git a/dlls/subs.cpp b/dlls/subs.cpp index a1093661..b48fc0f4 100644 --- a/dlls/subs.cpp +++ b/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->SetThink( DelayThink ); + pTemp->SetThink( &DelayThink ); // Save the 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 pev->nextthink = pev->ltime + flTravelTime; - SetThink( LinearMoveDone ); + SetThink( &LinearMoveDone ); // scale the destdelta vector by the time spent traveling to get velocity 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 pev->nextthink = pev->ltime + flTravelTime; - SetThink( AngularMoveDone ); + SetThink( &AngularMoveDone ); // scale the destdelta vector by the time spent traveling to get velocity pev->avelocity = vecDestDelta / flTravelTime; diff --git a/dlls/talkmonster.cpp b/dlls/talkmonster.cpp index bf4bbe87..76ac05b7 100644 --- a/dlls/talkmonster.cpp +++ b/dlls/talkmonster.cpp @@ -640,7 +640,7 @@ void CTalkMonster :: Killed( entvars_t *pevAttacker, int iGib ) m_hTargetEnt = NULL; // Don't finish that sentence StopTalking(); - ResetUse(); + SetUse( NULL ); CBaseMonster::Killed( pevAttacker, iGib ); } diff --git a/dlls/tentacle.cpp b/dlls/tentacle.cpp index ef3ab574..921a7b7d 100644 --- a/dlls/tentacle.cpp +++ b/dlls/tentacle.cpp @@ -265,9 +265,9 @@ void CTentacle :: Spawn( ) m_bloodColor = BLOOD_COLOR_GREEN; - SetThink( Start ); - SetTouch( HitTouch ); - SetUse( CommandUse ); + SetThink( &Start ); + SetTouch( &HitTouch ); + SetUse( &CommandUse ); pev->nextthink = gpGlobals->time + 0.2; @@ -288,7 +288,7 @@ void CTentacle :: Spawn( ) m_MonsterState = MONSTERSTATE_IDLE; - // SetThink( Test ); + // SetThink( &Test ); UTIL_SetOrigin( pev, pev->origin ); } @@ -714,7 +714,7 @@ void CTentacle::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T { case USE_OFF: pev->takedamage = DAMAGE_NO; - SetThink( DieThink ); + SetThink( &DieThink ); m_iGoalAnim = TENTACLE_ANIM_Engine_Death1; break; case USE_ON: @@ -728,7 +728,7 @@ void CTentacle::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T break; case USE_TOGGLE: pev->takedamage = DAMAGE_NO; - SetThink( DieThink ); + SetThink( &DieThink ); m_iGoalAnim = TENTACLE_ANIM_Engine_Idle; 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( void ) { - SetThink( Cycle ); + SetThink( &Cycle ); if ( !g_fFlySound ) { diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index a75cbbca..d7c82806 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -73,7 +73,7 @@ void CFrictionModifier :: Spawn( void ) pev->solid = SOLID_TRIGGER; SET_MODEL(ENT(pev), STRING(pev->model)); // set size and link into world pev->movetype = MOVETYPE_NONE; - SetTouch( ChangeFriction ); + SetTouch( &ChangeFriction ); } @@ -344,8 +344,8 @@ void CMultiManager :: KeyValue( KeyValueData *pkvd ) void CMultiManager :: Spawn( void ) { pev->solid = SOLID_NOT; - SetUse ( ManagerUse ); - SetThink ( ManagerThink); + SetUse( &ManagerUse ); + SetThink( &ManagerThink); // Sort targets // Quick and dirty bubble sort @@ -397,13 +397,13 @@ void CMultiManager :: ManagerThink ( void ) if ( m_index >= m_cTargets )// have we fired all targets? { - ResetThink(); + SetThink( NULL ); if ( IsClone() ) { UTIL_Remove( this ); return; } - SetUse ( ManagerUse );// allow manager re-use + SetUse( &ManagerUse );// allow manager re-use } else pev->nextthink = m_startTime + m_flTargetDelay[ m_index ]; @@ -442,9 +442,9 @@ void CMultiManager :: ManagerUse ( CBaseEntity *pActivator, CBaseEntity *pCaller m_index = 0; 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; } @@ -618,7 +618,7 @@ void CTriggerMonsterJump :: Spawn ( void ) {// if targetted, spawn turned off pev->solid = SOLID_NOT; 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 UTIL_SetOrigin( pev, pev->origin ); // Unlink from trigger list - ResetThink(); + SetThink( NULL ); } void CTriggerMonsterJump :: Touch( CBaseEntity *pOther ) @@ -729,7 +729,7 @@ void CTriggerCDAudio :: PlayTrack( void ) { PlayCDTrack( (int)pev->health ); - ResetTouch(); + SetTouch( NULL ); UTIL_Remove( this ); } @@ -808,20 +808,20 @@ void CTargetCDAudio::Play( void ) void CTriggerHurt :: Spawn( void ) { InitTrigger(); - SetTouch ( HurtTouch ); + SetTouch( &HurtTouch ); if ( !FStringNull ( pev->targetname ) ) { - SetUse ( ToggleUse ); + SetUse( &ToggleUse ); } else { - ResetUse(); + SetUse( NULL ); } if (m_bitsDamageInflict & DMG_RADIATION) { - SetThink ( RadiationThink ); + SetThink( &RadiationThink ); pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5); } @@ -1080,7 +1080,7 @@ void CTriggerMultiple :: Spawn( void ) // } // else { - SetTouch( MultiTouch ); + SetTouch( &MultiTouch ); } } @@ -1177,16 +1177,16 @@ void CBaseTrigger :: ActivateMultiTrigger( CBaseEntity *pActivator ) if (m_flWait > 0) { - SetThink( MultiWaitOver ); + SetThink( &MultiWaitOver ); pev->nextthink = gpGlobals->time + m_flWait; } else { // we can't just remove (self) here, because this is a touch function // called while C code is looping through area links... - ResetTouch(); + SetTouch( NULL ); 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->solid = SOLID_BBOX; // } - ResetThink(); + SetThink( NULL ); } @@ -1266,7 +1266,7 @@ void CTriggerCounter :: Spawn( void ) if (m_cTriggersLeft == 0) m_cTriggersLeft = 2; - SetUse( CounterUse ); + SetUse( &CounterUse ); } // ====================== TRIGGER_CHANGELEVEL ================================ @@ -1411,11 +1411,11 @@ void CChangeLevel :: Spawn( void ) if (!FStringNull ( pev->targetname ) ) { - SetUse ( UseChangeLevel ); + SetUse( &UseChangeLevel ); } InitTrigger(); if ( !(pev->spawnflags & SF_CHANGELEVEL_USEONLY) ) - SetTouch( TouchChangeLevel ); + SetTouch( &TouchChangeLevel ); // ALERT( at_console, "TRANSITION: %s (%s)\n", m_szMapName, m_szLandmarkName ); } @@ -1732,7 +1732,7 @@ void NextLevel( void ) if (pChange->pev->nextthink < gpGlobals->time) { - pChange->SetThink( CChangeLevel::ExecuteChangeLevel ); + pChange->SetThink( &CChangeLevel::ExecuteChangeLevel ); 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. pev->solid = SOLID_NOT; - SetUse( ToggleUse ); + SetUse( &ToggleUse ); UTIL_SetOrigin( pev, pev->origin ); // Link into the list } @@ -1938,7 +1938,7 @@ void CTriggerTeleport :: Spawn( void ) { InitTrigger(); - SetTouch( TeleportTouch ); + SetTouch( &TeleportTouch ); } @@ -1963,7 +1963,7 @@ void CTriggerSave::Spawn( void ) } InitTrigger(); - SetTouch( SaveTouch ); + SetTouch( &SaveTouch ); } void CTriggerSave::SaveTouch( CBaseEntity *pOther ) @@ -1975,7 +1975,7 @@ void CTriggerSave::SaveTouch( CBaseEntity *pOther ) if ( !pOther->IsPlayer() ) return; - ResetTouch(); + SetTouch( NULL ); UTIL_Remove( this ); SERVER_COMMAND( "autosave\n" ); } @@ -1999,7 +1999,7 @@ void CTriggerEndSection::EndSectionUse( CBaseEntity *pActivator, CBaseEntity *pC if ( pActivator && !pActivator->IsNetClient() ) return; - ResetUse(); + SetUse( NULL ); if ( pev->message ) { @@ -2018,10 +2018,10 @@ void CTriggerEndSection::Spawn( void ) InitTrigger(); - SetUse ( EndSectionUse ); + SetUse( &EndSectionUse ); // If it is a "use only" trigger, then don't set the touch function. if ( ! (pev->spawnflags & SF_ENDSECTION_USEONLY) ) - SetTouch( EndSectionTouch ); + SetTouch( &EndSectionTouch ); } void CTriggerEndSection::EndSectionTouch( CBaseEntity *pOther ) @@ -2030,7 +2030,7 @@ void CTriggerEndSection::EndSectionTouch( CBaseEntity *pOther ) if ( !pOther->IsNetClient() ) return; - ResetTouch(); + SetTouch( NULL ); if (pev->message) { @@ -2064,7 +2064,7 @@ LINK_ENTITY_TO_CLASS( trigger_gravity, CTriggerGravity ); void CTriggerGravity::Spawn( void ) { InitTrigger(); - SetTouch( GravityTouch ); + SetTouch( &GravityTouch ); } 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) ); // follow the player down - SetThink( FollowTarget ); + SetThink( &FollowTarget ); pev->nextthink = gpGlobals->time; m_moveDistance = 0; diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 6b039080..ce140f6c 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -120,7 +120,7 @@ void CTripmineGrenade :: Spawn( void ) m_flPowerUp = gpGlobals->time + 2.5; } - SetThink( PowerupThink ); + SetThink( &PowerupThink ); pev->nextthink = gpGlobals->time + 0.2; 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 ); // set to power up - SetThink( PowerupThink ); + SetThink( &PowerupThink ); 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_BODY, "weapons/mine_charge.wav" ); - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); 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 ); KillBeam(); @@ -206,7 +206,7 @@ void CTripmineGrenade :: PowerupThink( void ) CBaseEntity *pMine = Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles ); pMine->pev->spawnflags |= SF_NORESPAWN; - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); KillBeam(); pev->nextthink = gpGlobals->time + 0.1; return; @@ -249,7 +249,7 @@ void CTripmineGrenade :: MakeBeam( void ) m_flBeamLength = tr.flFraction; // set to follow laser spot - SetThink( BeamBreakThink ); + SetThink( &BeamBreakThink ); pev->nextthink = gpGlobals->time + 0.1; Vector vecTmpEnd = pev->origin + m_vecDir * 2048 * m_flBeamLength; @@ -317,7 +317,7 @@ int CTripmineGrenade :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttac { // disable // Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles ); - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); pev->nextthink = gpGlobals->time + 0.1; KillBeam(); return FALSE; @@ -335,7 +335,7 @@ void CTripmineGrenade::Killed( entvars_t *pevAttacker, int iGib ) pev->owner = ENT( pevAttacker ); } - SetThink( DelayDeathThink ); + SetThink( &DelayDeathThink ); 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 @@ -420,7 +420,7 @@ void CTripmine::Holster( int skiplocal /* = 0 */ ) { // out of mines m_pPlayer->pev->weapons &= ~(1<nextthink = gpGlobals->time + 0.1; } diff --git a/dlls/turret.cpp b/dlls/turret.cpp index efd9b5a5..cc28f0bb 100644 --- a/dlls/turret.cpp +++ b/dlls/turret.cpp @@ -257,7 +257,7 @@ void CBaseTurret::Spawn() pev->takedamage = DAMAGE_AIM; SetBits (pev->flags, FL_MONSTER); - SetUse( TurretUse ); + SetUse( &TurretUse ); if (( pev->spawnflags & SF_MONSTER_TURRET_AUTOACTIVATE ) && !( pev->spawnflags & SF_MONSTER_TURRET_STARTINACTIVE )) @@ -307,7 +307,7 @@ void CTurret::Spawn() m_iMinPitch = -15; 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->SetTransparency( kRenderGlow, 255, 0, 0, 0, kRenderFxNoDissipation ); @@ -339,7 +339,7 @@ void CMiniTurret::Spawn() m_iMinPitch = -15; UTIL_SetSize(pev, Vector(-16, -16, -m_iRetractHeight), Vector(16, 16, m_iRetractHeight)); - SetThink(Initialize); + SetThink( &Initialize); pev->nextthink = gpGlobals->time + 0.3; } @@ -381,11 +381,11 @@ void CBaseTurret::Initialize(void) if (m_iAutoStart) { m_flLastSight = gpGlobals->time + m_flMaxWait; - SetThink(AutoSearchThink); + SetThink( &AutoSearchThink); pev->nextthink = gpGlobals->time + .1; } else - SetThink(SUB_DoNothing); + SetThink( &SUB_DoNothing); } 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; m_iAutoStart = FALSE;// switching off a turret disables autostart //!!!! this should spin down first!!BUGBUG - SetThink(Retire); + SetThink( &Retire); } else { @@ -411,7 +411,7 @@ void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ m_iAutoStart = TRUE; } - SetThink(Deploy); + SetThink( &Deploy); } } @@ -472,7 +472,7 @@ void CBaseTurret::ActiveThink(void) { m_hEnemy = NULL; m_flLastSight = gpGlobals->time + m_flMaxWait; - SetThink(SearchThink); + SetThink( &SearchThink); return; } @@ -489,7 +489,7 @@ void CBaseTurret::ActiveThink(void) { m_hEnemy = NULL; m_flLastSight = gpGlobals->time + m_flMaxWait; - SetThink(SearchThink); + SetThink( &SearchThink); return; } } @@ -518,7 +518,7 @@ void CBaseTurret::ActiveThink(void) { m_hEnemy = NULL; m_flLastSight = gpGlobals->time + m_flMaxWait; - SetThink(SearchThink); + SetThink( &SearchThink); return; } } @@ -670,7 +670,7 @@ void CBaseTurret::Deploy(void) SetTurretAnim(TURRET_ANIM_SPIN); pev->framerate = 0; - SetThink(SearchThink); + SetThink( &SearchThink); } m_flLastSight = gpGlobals->time + m_flMaxWait; @@ -710,11 +710,11 @@ void CBaseTurret::Retire(void) UTIL_SetSize(pev, pev->mins, pev->maxs); if (m_iAutoStart) { - SetThink(AutoSearchThink); + SetThink( &AutoSearchThink); pev->nextthink = gpGlobals->time + .1; } else - SetThink(SUB_DoNothing); + SetThink( &SUB_DoNothing); } } else @@ -746,7 +746,7 @@ void CTurret::SpinUpCall(void) { pev->nextthink = gpGlobals->time + 0.1; // retarget delay EMIT_SOUND(ENT(pev), CHAN_STATIC, "turret/tu_active2.wav", TURRET_MACHINE_VOLUME, ATTN_NORM); - SetThink(ActiveThink); + SetThink( &ActiveThink); m_iStartSpin = 0; m_iSpin = 1; } @@ -758,7 +758,7 @@ void CTurret::SpinUpCall(void) if (m_iSpin) { - SetThink(ActiveThink); + SetThink( &ActiveThink); } } @@ -856,7 +856,7 @@ void CBaseTurret::SearchThink(void) { m_flLastSight = 0; m_flSpinUpTime = 0; - SetThink(ActiveThink); + SetThink( &ActiveThink); } else { @@ -866,7 +866,7 @@ void CBaseTurret::SearchThink(void) //Before we retrace, make sure that we are spun down. m_flLastSight = 0; m_flSpinUpTime = 0; - SetThink(Retire); + SetThink( &Retire); } // should we stop the spin? else if ((m_flSpinUpTime) && (gpGlobals->time > m_flSpinUpTime)) @@ -911,7 +911,7 @@ void CBaseTurret::AutoSearchThink(void) if (m_hEnemy != NULL) { - SetThink(Deploy); + SetThink( &Deploy); 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) { 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??? - ResetUse(); - SetThink(TurretDeath); + SetUse( NULL ); + SetThink( &TurretDeath); SUB_UseTargets( this, USE_ON, 0 ); // wake up others 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)) { m_fBeserk = 1; - SetThink(SearchThink); + SetThink( &SearchThink); } } @@ -1179,8 +1179,8 @@ void CSentry::Spawn() m_iMinPitch = -60; UTIL_SetSize(pev, Vector(-16, -16, -m_iRetractHeight), Vector(16, 16, m_iRetractHeight)); - SetTouch(SentryTouch); - SetThink(Initialize); + SetTouch( &SentryTouch); + SetThink( &Initialize); pev->nextthink = gpGlobals->time + 0.3; } @@ -1204,8 +1204,8 @@ int CSentry::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float f if (!m_iOn) { - SetThink( Deploy ); - ResetUse(); + SetThink( &Deploy ); + SetUse( NULL ); 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??? - ResetUse(); - SetThink(SentryDeath); + SetUse( NULL ); + SetThink( &SentryDeath); SUB_UseTargets( this, USE_ON, 0 ); // wake up others pev->nextthink = gpGlobals->time + 0.1; @@ -1299,7 +1299,7 @@ void CSentry :: SentryDeath( void ) if (m_fSequenceFinished && pev->dmgtime + 5 < gpGlobals->time) { pev->framerate = 0; - ResetThink(); + SetThink( NULL ); } } diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 4a28819a..264edb88 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -477,8 +477,8 @@ void CBasePlayerItem :: FallInit( void ) UTIL_SetOrigin( pev, pev->origin ); UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0) );//pointsize until it lands on the ground. - SetTouch( DefaultTouch ); - SetThink( FallThink ); + SetTouch( &DefaultTouch ); + SetThink( &FallThink ); pev->nextthink = gpGlobals->time + 0.1; } @@ -528,8 +528,8 @@ void CBasePlayerItem::Materialize( void ) pev->solid = SOLID_TRIGGER; UTIL_SetOrigin( pev, pev->origin );// link into world. - SetTouch (DefaultTouch); - ResetThink(); + SetTouch( &DefaultTouch); + SetThink( NULL ); } @@ -580,8 +580,8 @@ CBaseEntity* CBasePlayerItem::Respawn( void ) if ( pNewWeapon ) { pNewWeapon->pev->effects |= EF_NODRAW;// invisible for now - pNewWeapon->ResetTouch();// no touch - pNewWeapon->SetThink( AttemptToMaterialize ); + pNewWeapon->SetTouch( NULL );// no touch + pNewWeapon->SetThink( &AttemptToMaterialize ); DROP_TO_FLOOR ( ENT(pev) ); @@ -738,15 +738,15 @@ int CBasePlayerItem::AddToPlayer( CBasePlayer *pPlayer ) void CBasePlayerItem::Drop( void ) { - ResetTouch(); - SetThink(SUB_Remove); + SetTouch( NULL ); + SetThink( &SUB_Remove); pev->nextthink = gpGlobals->time + .1; } void CBasePlayerItem::Kill( void ) { - ResetTouch(); - SetThink(SUB_Remove); + SetTouch( NULL ); + SetThink( &SUB_Remove); pev->nextthink = gpGlobals->time + .1; } @@ -766,8 +766,8 @@ void CBasePlayerItem::AttachToPlayer ( CBasePlayer *pPlayer ) pev->model = iStringNull; pev->owner = pPlayer->edict(); pev->nextthink = gpGlobals->time + .1; - ResetTouch(); - ResetThink(); + SetTouch( NULL ); + SetThink( NULL ); } // 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_SetOrigin( pev, pev->origin ); - SetTouch( DefaultTouch ); + SetTouch( &DefaultTouch ); } CBaseEntity* CBasePlayerAmmo::Respawn( void ) { pev->effects |= EF_NODRAW; - ResetTouch(); + SetTouch( NULL ); 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 ); return this; @@ -1092,7 +1092,7 @@ void CBasePlayerAmmo::Materialize( void ) pev->effects |= EF_MUZZLEFLASH; } - SetTouch( DefaultTouch ); + SetTouch( &DefaultTouch ); } void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther ) @@ -1110,16 +1110,16 @@ void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther ) } else { - ResetTouch(); - SetThink(SUB_Remove); + SetTouch( NULL ); + SetThink( &SUB_Remove); pev->nextthink = gpGlobals->time + .1; } } else if (gEvilImpulse101) { // evil impulse 101 hack, kill always - ResetTouch(); - SetThink(SUB_Remove); + SetTouch( NULL ); + SetThink( &SUB_Remove); pev->nextthink = gpGlobals->time + .1; } } @@ -1256,7 +1256,7 @@ void CWeaponBox::Kill( void ) while ( pWeapon ) { - pWeapon->SetThink(SUB_Remove); + pWeapon->SetThink( &SUB_Remove); pWeapon->pev->nextthink = gpGlobals->time + 0.1; 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 ); - ResetTouch(); + SetTouch( NULL ); UTIL_Remove(this); } @@ -1380,8 +1380,8 @@ BOOL CWeaponBox::PackWeapon( CBasePlayerItem *pWeapon ) pWeapon->pev->modelindex = 0; pWeapon->pev->model = iStringNull; pWeapon->pev->owner = edict(); - pWeapon->ResetThink();// crowbar may be trying to swing again, etc. - pWeapon->ResetTouch(); + pWeapon->SetThink( NULL );// crowbar may be trying to swing again, etc. + pWeapon->SetTouch( NULL ); pWeapon->m_pPlayer = NULL; //ALERT ( at_console, "packed %s\n", STRING(pWeapon->pev->classname) ); diff --git a/dlls/world.cpp b/dlls/world.cpp index 82a6e822..cb20add3 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -125,15 +125,15 @@ void CDecal :: Spawn( void ) 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. pev->nextthink = gpGlobals->time; } else { // if there IS a targetname, the decal sprays itself on when it is triggered. - SetThink ( SUB_DoNothing ); - SetUse(TriggerDecal); + SetThink( &SUB_DoNothing ); + SetUse( &TriggerDecal); } } @@ -158,7 +158,7 @@ void CDecal :: TriggerDecal ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE WRITE_SHORT( (int)VARS(trace.pHit)->modelindex ); MESSAGE_END(); - SetThink( SUB_Remove ); + SetThink( &SUB_Remove ); 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 ); if ( pEntity ) { - pEntity->SetThink( SUB_CallUseToggle ); + pEntity->SetThink( &SUB_CallUseToggle ); pEntity->pev->message = pev->netname; pev->netname = 0; pEntity->pev->nextthink = gpGlobals->time + 0.3;