From b98bfe7578876a23b562842bd99c595db4f62ff8 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Fri, 15 Apr 2016 00:48:22 +0500 Subject: [PATCH 1/3] Remove duplicate header. --- cl_dll/wrect.h | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 cl_dll/wrect.h diff --git a/cl_dll/wrect.h b/cl_dll/wrect.h deleted file mode 100644 index 620b8163..00000000 --- a/cl_dll/wrect.h +++ /dev/null @@ -1,16 +0,0 @@ -//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#if !defined( WRECTH ) -#define WRECTH - -typedef struct rect_s -{ - int left, right, top, bottom; -} wrect_t; - -#endif \ No newline at end of file From 0adbd65d8a3bb95c7408814e002a3d1dae4bd370 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Mon, 18 Apr 2016 01:30:05 +0500 Subject: [PATCH 2/3] Fix build clang. Fix UB. --- cl_dll/StudioModelRenderer.cpp | 4 +- cl_dll/camera.h | 2 +- cl_dll/cl_util.h | 4 +- cl_dll/death.cpp | 3 +- cl_dll/entity.cpp | 4 +- cl_dll/geiger.cpp | 2 +- cl_dll/health.cpp | 6 +-- cl_dll/hl/hl_weapons.cpp | 2 +- cl_dll/hud.cpp | 5 ++- cl_dll/hud_spectator.cpp | 3 ++ cl_dll/menu.cpp | 4 +- cl_dll/message.cpp | 2 +- cl_dll/saytext.cpp | 3 +- cl_dll/scoreboard.cpp | 2 +- cl_dll/status_icons.cpp | 4 +- cl_dll/view.cpp | 5 +-- dlls/aflock.cpp | 14 +++---- dlls/airtank.cpp | 4 +- dlls/apache.cpp | 24 ++++++------ dlls/barnacle.cpp | 4 +- dlls/barney.cpp | 2 +- dlls/bigmomma.cpp | 2 +- dlls/bmodels.cpp | 30 +++++++-------- dlls/bullsquid.cpp | 4 +- dlls/buttons.cpp | 46 +++++++++++------------ dlls/client.cpp | 4 +- dlls/combat.cpp | 16 ++++---- dlls/controller.cpp | 10 ++--- dlls/crossbow.cpp | 10 ++--- dlls/crowbar.cpp | 4 +- dlls/doors.cpp | 20 +++++----- dlls/effects.cpp | 40 ++++++++++---------- dlls/effects.h | 4 +- dlls/explode.cpp | 2 +- dlls/func_break.cpp | 8 ++-- dlls/gargantua.cpp | 8 ++-- dlls/ggrenade.cpp | 22 +++++------ dlls/h_battery.cpp | 10 ++--- dlls/h_cine.cpp | 10 ++--- dlls/h_cycler.cpp | 2 +- dlls/handgrenade.cpp | 2 +- dlls/headcrab.cpp | 2 +- dlls/healthkit.cpp | 10 ++--- dlls/hgrunt.cpp | 4 +- dlls/hornet.cpp | 16 ++++---- dlls/houndeye.cpp | 2 +- dlls/ichthyosaur.cpp | 6 +-- dlls/items.cpp | 6 +-- dlls/leech.cpp | 4 +- dlls/monstermaker.cpp | 12 +++--- dlls/monsters.cpp | 8 ++-- dlls/mortar.cpp | 6 +-- dlls/multiplay_gamerules.cpp | 2 +- dlls/nihilanth.cpp | 33 +++++++++-------- dlls/nodes.cpp | 68 +++++++++++++++++++--------------- dlls/osprey.cpp | 18 ++++----- dlls/plats.cpp | 50 ++++++++++++------------- dlls/player.cpp | 18 ++++----- dlls/player.h | 2 +- dlls/roach.cpp | 2 +- dlls/rpg.cpp | 12 +++--- dlls/satchel.cpp | 10 ++--- dlls/saverestore.h | 2 +- dlls/scientist.cpp | 6 +-- dlls/scripted.cpp | 18 ++++----- dlls/sound.cpp | 14 +++---- dlls/soundent.cpp | 4 +- dlls/squeakgrenade.cpp | 12 +++--- dlls/subs.cpp | 6 +-- dlls/talkmonster.cpp | 12 +++--- dlls/tempmonster.cpp | 2 +- dlls/tentacle.cpp | 14 +++---- dlls/triggers.cpp | 46 +++++++++++------------ dlls/tripmine.cpp | 16 ++++---- dlls/turret.cpp | 48 ++++++++++++------------ dlls/util.cpp | 4 +- dlls/util.h | 4 +- dlls/weapons.cpp | 24 ++++++------ dlls/weapons.h | 2 +- dlls/world.cpp | 12 +++--- game_shared/bitvec.h | 2 +- game_shared/voice_gamemgr.cpp | 4 +- 82 files changed, 459 insertions(+), 441 deletions(-) diff --git a/cl_dll/StudioModelRenderer.cpp b/cl_dll/StudioModelRenderer.cpp index e0845c29..ee8ae56f 100644 --- a/cl_dll/StudioModelRenderer.cpp +++ b/cl_dll/StudioModelRenderer.cpp @@ -782,7 +782,7 @@ StudioSetupBones */ void CStudioModelRenderer::StudioSetupBones ( void ) { - int i; + int i, j; double f; mstudiobone_t *pbones; @@ -911,7 +911,7 @@ void CStudioModelRenderer::StudioSetupBones ( void ) for (i = 0; i < m_pStudioHeader->numbones; i++) { - for( int j = 0; j < LEGS_BONES_COUNT; j++ ) + for( j = 0; j < LEGS_BONES_COUNT; j++ ) { if( !strcmp( pbones[i].name, legs_bones[j] )) break; diff --git a/cl_dll/camera.h b/cl_dll/camera.h index af1591d7..83dc04ff 100644 --- a/cl_dll/camera.h +++ b/cl_dll/camera.h @@ -9,7 +9,7 @@ // NOTE: must include quakedef.h first #ifndef _CAMERA_H_ -#define _CAMEA_H_ +#define _CAMERA_H_ // pitch, yaw, dist extern vec3_t cam_ofs; diff --git a/cl_dll/cl_util.h b/cl_dll/cl_util.h index 4876ca27..436b122b 100644 --- a/cl_dll/cl_util.h +++ b/cl_dll/cl_util.h @@ -84,7 +84,7 @@ inline struct cvar_s *CVAR_CREATE( const char *cv, const char *val, const int fl #define AngleVectors (*gEngfuncs.pfnAngleVectors) extern cvar_t *hud_textmode; extern float g_hud_text_color[3]; -inline int DrawSetTextColor(float r, float g, float b) +inline void DrawSetTextColor(float r, float g, float b) { if( hud_textmode->value == 1 ) g_hud_text_color[0]=r, g_hud_text_color[1] = g, g_hud_text_color[2] = b; @@ -111,7 +111,7 @@ inline int DrawConsoleString( int x, int y, const char *string ) inline void GetConsoleStringSize( const char *string, int *width, int *height ) { if( hud_textmode->value == 1 ) - *height = 13, *width = gHUD.DrawHudStringLen(string); + *height = 13, *width = gHUD.DrawHudStringLen( (char*)string ); else gEngfuncs.pfnDrawConsoleStringLen( (char*)string, width, height ); } diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index 760b005c..fdeaae46 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -157,6 +157,7 @@ int CHudDeathNotice :: Draw( float flTime ) // This message handler may be better off elsewhere int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbuf ) { + int i; m_iFlags |= HUD_ACTIVE; BEGIN_READ( pbuf, iSize ); @@ -171,7 +172,7 @@ int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *p gHUD.m_Spectator.DeathMessage(victim); - for ( int i = 0; i < MAX_DEATHNOTICES; i++ ) + for ( i = 0; i < MAX_DEATHNOTICES; i++ ) { if ( rgDeathNoticeList[i].iId == 0 ) break; diff --git a/cl_dll/entity.cpp b/cl_dll/entity.cpp index d8d8f015..fb5770c6 100644 --- a/cl_dll/entity.cpp +++ b/cl_dll/entity.cpp @@ -723,8 +723,8 @@ void DLLEXPORT HUD_TempEntUpdate ( s = sin( pTemp->entity.baseline.origin[2] + fastFreq ); c = cos( pTemp->entity.baseline.origin[2] + fastFreq ); - pTemp->entity.origin[0] += pTemp->entity.baseline.origin[0] * frametime + 8 * sin( client_time * 20 + (int)pTemp ); - pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * frametime + 4 * sin( client_time * 30 + (int)pTemp ); + pTemp->entity.origin[0] += pTemp->entity.baseline.origin[0] * frametime + 8 * sin( client_time * 20 + (int)(size_t)pTemp ); + pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * frametime + 4 * sin( client_time * 30 + (int)(size_t)pTemp ); pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime; } diff --git a/cl_dll/geiger.cpp b/cl_dll/geiger.cpp index 6f5f984f..1a514815 100644 --- a/cl_dll/geiger.cpp +++ b/cl_dll/geiger.cpp @@ -64,7 +64,7 @@ int CHudGeiger::MsgFunc_Geiger(const char *pszName, int iSize, void *pbuf) int CHudGeiger::Draw (float flTime) { int pct; - float flvol; + float flvol = 0.0f; int rg[3]; int i; diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index 0b73efca..9a4ff660 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -377,7 +377,7 @@ int CHudHealth::DrawPain(float flTime) int CHudHealth::DrawDamage(float flTime) { - int r, g, b, a; + int i, r, g, b, a; DAMAGE_IMAGE *pdmg; if (!m_bitsDamage) @@ -390,7 +390,7 @@ int CHudHealth::DrawDamage(float flTime) ScaleColors(r, g, b, a); // Draw all the items - for (int i = 0; i < NUM_DMG_TYPES; i++) + for (i = 0; i < NUM_DMG_TYPES; i++) { if (m_bitsDamage & giDmgFlags[i]) { @@ -404,7 +404,7 @@ int CHudHealth::DrawDamage(float flTime) // check for bits that should be expired for ( i = 0; i < NUM_DMG_TYPES; i++ ) { - DAMAGE_IMAGE *pdmg = &m_dmg[i]; + pdmg = &m_dmg[i]; if ( m_bitsDamage & giDmgFlags[i] ) { diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 3572bdaa..581b2e89 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -621,7 +621,7 @@ void HUD_InitClientWeapons( void ) // Pass through to engine g_engfuncs.pfnPrecacheEvent = gEngfuncs.pfnPrecacheEvent; g_engfuncs.pfnRandomFloat = gEngfuncs.pfnRandomFloat; - g_engfuncs.pfnRandomLong = RandomLong; + g_engfuncs.pfnRandomLong = gEngfuncs.pfnRandomLong; // Allocate a slot for the local player HUD_PrepEntity( &player , NULL ); diff --git a/cl_dll/hud.cpp b/cl_dll/hud.cpp index 36bb50ad..d99ce6bb 100644 --- a/cl_dll/hud.cpp +++ b/cl_dll/hud.cpp @@ -280,6 +280,7 @@ int CHud :: GetSpriteIndex( const char *SpriteName ) void CHud :: VidInit( void ) { + int j; m_scrinfo.iSize = sizeof(m_scrinfo); GetScreenInfo(&m_scrinfo); @@ -307,7 +308,7 @@ void CHud :: VidInit( void ) // count the number of sprites of the appropriate res m_iSpriteCount = 0; client_sprite_t *p = m_pSpriteList; - for ( int j = 0; j < m_iSpriteCountAllRes; j++ ) + for ( j = 0; j < m_iSpriteCountAllRes; j++ ) { if ( p->iRes == m_iRes ) m_iSpriteCount++; @@ -346,7 +347,7 @@ void CHud :: VidInit( void ) // count the number of sprites of the appropriate res m_iSpriteCount = 0; - for ( int j = 0; j < m_iSpriteCountAllRes; j++ ) + for ( j = 0; j < m_iSpriteCountAllRes; j++ ) { if ( p->iRes == m_iRes ) m_iSpriteCount++; diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index be6d45e8..33a95d35 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -874,6 +874,9 @@ bool CHudSpectator::ParseOverviewFile( ) char *pfile = NULL; + memset( filename, 0, 255 ); + memset( levelname, 0, 255 ); + memset( token, 0, 1024 ); memset( &m_OverviewData, 0, sizeof(m_OverviewData)); // fill in standrd values diff --git a/cl_dll/menu.cpp b/cl_dll/menu.cpp index 60ae2403..f43984dd 100644 --- a/cl_dll/menu.cpp +++ b/cl_dll/menu.cpp @@ -64,6 +64,8 @@ int CHudMenu :: VidInit( void ) int CHudMenu :: Draw( float flTime ) { + int i; + // check for if menu is set to disappear if ( m_flShutoffTime > 0 ) { @@ -83,7 +85,7 @@ int CHudMenu :: Draw( float flTime ) // count the number of newlines int nlc = 0; - for ( int i = 0; i < MAX_MENU_STRING && g_szMenuString[i] != '\0'; i++ ) + for ( i = 0; i < MAX_MENU_STRING && g_szMenuString[i] != '\0'; i++ ) { if ( g_szMenuString[i] == '\n' ) nlc++; diff --git a/cl_dll/message.cpp b/cl_dll/message.cpp index 61ea55a7..e6bb857d 100644 --- a/cl_dll/message.cpp +++ b/cl_dll/message.cpp @@ -140,7 +140,7 @@ int CHudMessage::YPosition( float y, int height ) void CHudMessage::MessageScanNextChar( void ) { - int srcRed, srcGreen, srcBlue, destRed, destGreen, destBlue; + int srcRed, srcGreen, srcBlue, destRed = 0, destGreen = 0, destBlue = 0; int blend; srcRed = m_parms.pMessage->r1; diff --git a/cl_dll/saytext.cpp b/cl_dll/saytext.cpp index 3a7616a5..ddfa00fe 100644 --- a/cl_dll/saytext.cpp +++ b/cl_dll/saytext.cpp @@ -162,10 +162,11 @@ int CHudSayText :: MsgFunc_SayText( const char *pszName, int iSize, void *pbuf ) void CHudSayText :: SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex ) { + int i; ConsolePrint( pszBuf ); // find an empty string slot - for ( int i = 0; i < MAX_LINES; i++ ) + for ( i = 0; i < MAX_LINES; i++ ) { if ( ! *g_szLineBuffer[i] ) break; diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index c7431328..9fca2b7a 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -526,7 +526,7 @@ int CHudScoreboard :: MsgFunc_TeamInfo( const char *pszName, int iSize, void *pb if ( j > m_iNumTeams ) { // they aren't in a listed team, so make a new one // search through for an empty team slot - for ( int j = 1; j <= m_iNumTeams; j++ ) + for ( j = 1; j <= m_iNumTeams; j++ ) { if ( g_TeamInfo[j].name[0] == '\0' ) break; diff --git a/cl_dll/status_icons.cpp b/cl_dll/status_icons.cpp index 9207143e..10ca630a 100644 --- a/cl_dll/status_icons.cpp +++ b/cl_dll/status_icons.cpp @@ -106,8 +106,10 @@ int CHudStatusIcons::MsgFunc_StatusIcon( const char *pszName, int iSize, void *p // add the icon to the icon list, and set it's drawing color void CHudStatusIcons::EnableIcon( char *pszIconName, unsigned char red, unsigned char green, unsigned char blue ) { + int i; + // check to see if the sprite is in the current list - for ( int i = 0; i < MAX_ICONSPRITES; i++ ) + for ( i = 0; i < MAX_ICONSPRITES; i++ ) { if ( !stricmp( m_IconList[i].szSpriteName, pszIconName ) ) break; diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index 2af0f8c9..5c022148 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -134,7 +134,7 @@ void V_NormalizeAngles( float *angles ) } } -/* + =================== V_InterpolateAngles @@ -466,7 +466,7 @@ void V_CalcNormalRefdef ( struct ref_params_s *pparams ) waterOffset = 0; if ( pparams->waterlevel >= 2 ) { - int i, contents, waterDist, waterEntity; + int contents, waterDist, waterEntity; vec3_t point; waterDist = cl_waterdist->value; @@ -661,7 +661,6 @@ void V_CalcNormalRefdef ( struct ref_params_s *pparams ) ( pparams->smoothing && ( pparams->maxclients > 1 ) ) ) { int foundidx; - int i; float t; if ( cl_vsmoothing->value < 0.0 ) diff --git a/dlls/aflock.cpp b/dlls/aflock.cpp index f536b4f0..95e3dc16 100644 --- a/dlls/aflock.cpp +++ b/dlls/aflock.cpp @@ -229,7 +229,7 @@ void CFlockingFlyer :: Spawn( ) pev->frame = 0; pev->nextthink = gpGlobals->time + 0.1; - SetThink( &IdleThink ); + SetThink( &CFlockingFlyer::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( &CFlockingFlyer::FallHack ); pev->nextthink = gpGlobals->time + 0.1; } @@ -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( &CFlockingFlyer::Start ); pev->nextthink = gpGlobals->time + 0.1; } } @@ -380,11 +380,11 @@ void CFlockingFlyer :: Start( void ) if ( IsLeader() ) { - SetThink( &FlockLeaderThink ); + SetThink( &CFlockingFlyer::FlockLeaderThink ); } else { - SetThink( &FlockFollowerThink ); + SetThink( &CFlockingFlyer::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( &CFlockingFlyer::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( &CFlockingFlyer::FlockLeaderThink ); return; } diff --git a/dlls/airtank.cpp b/dlls/airtank.cpp index b244f581..27901fc7 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( &CAirtank::TankTouch ); + SetThink( &CAirtank::TankThink ); pev->flags |= FL_MONSTER; pev->takedamage = DAMAGE_YES; diff --git a/dlls/apache.cpp b/dlls/apache.cpp index fae0ff34..607679bf 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( &CApache::StartupUse ); } else { - SetThink( &HuntThink ); - SetTouch( &FlyTouch ); + SetThink( &CApache::HuntThink ); + SetTouch( &CApache::FlyTouch ); pev->nextthink = gpGlobals->time + 1.0; } @@ -186,8 +186,8 @@ void CApache::NullThink( void ) void CApache::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { - SetThink( &HuntThink ); - SetTouch( &FlyTouch ); + SetThink( &CApache::HuntThink ); + SetTouch( &CApache::FlyTouch ); pev->nextthink = gpGlobals->time + 0.1; SetUse( NULL ); } @@ -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( &CApache::DyingThink ); + SetTouch( &CApache::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( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time + 0.1; } } @@ -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( &CApacheHVR::IgniteThink ); + SetTouch( &CGrenade::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( &CApacheHVR::AccelerateThink ); pev->nextthink = gpGlobals->time + 0.1; } @@ -1047,4 +1047,4 @@ void CApacheHVR :: AccelerateThink( void ) } -#endif \ No newline at end of file +#endif diff --git a/dlls/barnacle.cpp b/dlls/barnacle.cpp index aaf8c539..1681b5a3 100644 --- a/dlls/barnacle.cpp +++ b/dlls/barnacle.cpp @@ -137,7 +137,7 @@ void CBarnacle :: Spawn() SetActivity ( ACT_IDLE ); - SetThink( &BarnacleThink ); + SetThink( &CBarnacle::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( &CBarnacle::WaitTillDead ); } //========================================================= diff --git a/dlls/barney.cpp b/dlls/barney.cpp index 7837c5c0..9cfa6a37 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( &CTalkMonster::FollowerUse ); } //========================================================= diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index 06f98da1..b7f999d1 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( &CBMortar::Animate ); pSpit->pev->nextthink = gpGlobals->time + 0.1; return pSpit; diff --git a/dlls/bmodels.cpp b/dlls/bmodels.cpp index 1ab8afc7..bc788a93 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( &CFuncRotating::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( &CBaseEntity::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( &CFuncRotating::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( &CFuncRotating::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( &CFuncRotating::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( &CFuncRotating::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( &CFuncRotating::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( &CFuncRotating::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( &CFuncRotating::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( &CFuncRotating::Rotate ); Rotate(); } } @@ -812,15 +812,15 @@ void CPendulum :: Spawn( void ) if ( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT) ) { - SetThink( &SUB_CallUseToggle ); + SetThink( &CBaseEntity::SUB_CallUseToggle ); pev->nextthink = gpGlobals->time + 0.1; } pev->speed = 0; - SetUse( &PendulumUse ); + SetUse( &CPendulum::PendulumUse ); if ( FBitSet( pev->spawnflags, SF_PENDULUM_SWING ) ) { - SetTouch( &RopeTouch ); + SetTouch( &CPendulum::RopeTouch ); } } @@ -837,7 +837,7 @@ void CPendulum :: PendulumUse( CBaseEntity *pActivator, CBaseEntity *pCaller, US pev->avelocity = m_maxSpeed * pev->movedir; pev->nextthink = pev->ltime + (delta / m_maxSpeed); - SetThink( &Stop ); + SetThink( &CPendulum::Stop ); } else { @@ -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( &CPendulum::Swing ); m_dampSpeed = m_maxSpeed; } } diff --git a/dlls/bullsquid.cpp b/dlls/bullsquid.cpp index 6a1ffe19..0e34a537 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( &CSquidSpit::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( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time; } diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 44f413bc..8ca2ad60 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( &CMultiSource::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( &CBaseEntity::SUB_DoNothing); // search for all entities which target this multisource (pev->targetname) @@ -455,7 +455,7 @@ void CBaseButton::Spawn( ) if ( FBitSet ( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) )// this button should spark in OFF state { - SetThink( &ButtonSpark ); + SetThink( &CBaseButton::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( &CBaseButton::ButtonTouch ); } else { SetTouch( NULL ); - SetUse( &ButtonUse ); + SetUse( &CBaseButton::ButtonUse ); } } @@ -567,7 +567,7 @@ void DoSpark(entvars_t *pev, const Vector &location ) void CBaseButton::ButtonSpark ( void ) { - SetThink( &ButtonSpark ); + SetThink( &CBaseButton::ButtonSpark ); pev->nextthink = gpGlobals->time + ( 0.1 + RANDOM_FLOAT ( 0, 1.5 ) );// spark again at random interval DoSpark( pev, pev->mins ); @@ -680,7 +680,7 @@ void CBaseButton::ButtonActivate( ) ASSERT(m_toggle_state == TS_AT_BOTTOM); m_toggle_state = TS_GOING_UP; - SetMoveDone( &TriggerAndWait ); + SetMoveDone( &CBaseButton::TriggerAndWait ); if (!m_fRotating) LinearMove( m_vecPosition2, pev->speed); else @@ -709,12 +709,12 @@ void CBaseButton::TriggerAndWait( void ) SetTouch( NULL ); } else - SetTouch( &ButtonTouch ); + SetTouch( &CBaseButton::ButtonTouch ); } else { pev->nextthink = pev->ltime + m_flWait; - SetThink( &ButtonReturn ); + SetThink( &CBaseButton::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( &CBaseButton::ButtonBackHome ); if (!m_fRotating) LinearMove( m_vecPosition1, pev->speed); else @@ -784,12 +784,12 @@ void CBaseButton::ButtonBackHome( void ) SetTouch( NULL ); } else - SetTouch( &ButtonTouch ); + SetTouch( &CBaseButton::ButtonTouch ); // reset think for a sparking button if ( FBitSet ( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) ) { - SetThink( &ButtonSpark ); + SetThink( &CBaseButton::ButtonSpark ); pev->nextthink = gpGlobals->time + 0.5;// no hurry. } } @@ -857,10 +857,10 @@ void CRotButton::Spawn( void ) if ( !FBitSet ( pev->spawnflags, SF_BUTTON_TOUCH_ONLY ) ) { SetTouch( NULL ); - SetUse( &ButtonUse ); + SetUse( &CBaseButton::ButtonUse ); } else // touchable button - SetTouch( &ButtonTouch ); + SetTouch( &CBaseButton::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( &CMomentaryRotButton::Off ); } void CMomentaryRotButton::UpdateTarget( float value ) @@ -1077,7 +1077,7 @@ void CMomentaryRotButton::Off( void ) m_lastUsed = 0; if ( FBitSet( pev->spawnflags, SF_PENDULUM_AUTO_RETURN ) && m_returnSpeed > 0 ) { - SetThink( &Return ); + SetThink( &CMomentaryRotButton::Return ); pev->nextthink = pev->ltime + 0.1; m_direction = -1; } @@ -1154,14 +1154,14 @@ void CEnvSpark::Spawn(void) { if (FBitSet(pev->spawnflags, 64)) // Start on { - SetThink( &SparkThink); // start sparking - SetUse( &SparkStop); // set up +USE to stop sparking + SetThink( &CEnvSpark::SparkThink); // start sparking + SetUse( &CEnvSpark::SparkStop); // set up +USE to stop sparking } else - SetUse( &SparkStart); + SetUse( &CEnvSpark::SparkStart); } else - SetThink( &SparkThink); + SetThink( &CEnvSpark::SparkThink); pev->nextthink = gpGlobals->time + ( 0.1 + RANDOM_FLOAT ( 0, 1.5 ) ); @@ -1208,14 +1208,14 @@ void EXPORT CEnvSpark::SparkThink(void) void EXPORT CEnvSpark::SparkStart(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { - SetUse( &SparkStop); - SetThink( &SparkThink); + SetUse( &CEnvSpark::SparkStop); + SetThink( &CEnvSpark::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); + SetUse( &CEnvSpark::SparkStart); SetThink( NULL ); } diff --git a/dlls/client.cpp b/dlls/client.cpp index 01355bbb..f17b6e54 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -217,7 +217,7 @@ void Host_Say( edict_t *pEntity, int teamonly ) { CBasePlayer *client; int j; - char *p; + char *p, *pc; char text[128]; char szTemp[256]; const char *cpSay = "say"; @@ -269,7 +269,7 @@ void Host_Say( edict_t *pEntity, int teamonly ) } // make sure the text has content - for ( char *pc = p; pc != NULL && *pc != 0; pc++ ) + for ( pc = p; pc != NULL && *pc != 0; pc++ ) { if ( !isspace( *pc ) ) { diff --git a/dlls/combat.cpp b/dlls/combat.cpp index 2899d051..9fec6047 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -115,7 +115,7 @@ 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->SetTouch( &CGib::StickyGibTouch ); pGib->SetThink( NULL ); } pGib->LimitVelocity(); @@ -331,7 +331,7 @@ void CBaseMonster :: GibMonster( void ) if ( gibbed ) { // don't remove players! - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time; } else @@ -654,7 +654,7 @@ void CBaseEntity :: SUB_StartFadeOut ( void ) pev->avelocity = g_vecZero; pev->nextthink = gpGlobals->time + 0.1; - SetThink( &SUB_FadeOut ); + SetThink( &CBaseEntity::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( &CBaseEntity::SUB_Remove ); } } @@ -688,7 +688,7 @@ void CGib :: WaitTillLand ( void ) if ( pev->velocity == g_vecZero ) { - SetThink( &SUB_StartFadeOut); + SetThink( &CBaseEntity::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( &CBaseEntity::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( &CGib::WaitTillLand ); + SetTouch( &CGib::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 0ade7ace..7e4dc1d0 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( &CControllerHeadBall::HuntThink ); + SetTouch( &CControllerHeadBall::BounceTouch ); m_vecIdeal = Vector( 0, 0, 0 ); @@ -1257,7 +1257,7 @@ void CControllerHeadBall :: HuntThink( void ) m_flNextAttack = gpGlobals->time + 3.0; - SetThink( &DieThink ); + SetThink( &CControllerHeadBall::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( &CControllerZapBall::AnimateThink ); + SetTouch( &CControllerZapBall::ExplodeTouch ); m_hOwner = Instance( pev->owner ); pev->dmgtime = gpGlobals->time; // keep track of when ball spawned diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index 2a9224cd..59870b87 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( &CCrossbowBolt::BoltTouch ); + SetThink( &CCrossbowBolt::BubbleThink ); pev->nextthink = gpGlobals->time + 0.2; } @@ -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( &CBaseEntity::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( &CCrossbowBolt::ExplodeThink ); pev->nextthink = gpGlobals->time + 0.1; } } @@ -561,4 +561,4 @@ LINK_ENTITY_TO_CLASS( ammo_crossbow, CCrossbowAmmo ); -#endif \ No newline at end of file +#endif diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index de6ad845..ef21e503 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -147,7 +147,7 @@ void CCrowbar::PrimaryAttack() { if (! Swing( 1 )) { - SetThink( &SwingAgain ); + SetThink( &CCrowbar::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( &CCrowbar::Smack ); pev->nextthink = UTIL_WeaponTimeBase() + 0.2; diff --git a/dlls/doors.cpp b/dlls/doors.cpp index 44815efb..5a5249c5 100644 --- a/dlls/doors.cpp +++ b/dlls/doors.cpp @@ -320,7 +320,7 @@ void CBaseDoor::Spawn( ) SetTouch( NULL ); } else // touchable button - SetTouch( &DoorTouch ); + SetTouch( &CBaseDoor::DoorTouch ); } @@ -520,7 +520,7 @@ void CBaseDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use { m_hActivator = pActivator; // if not ready to be used, ignore "use" command. - if (m_toggle_state == TS_AT_BOTTOM || FBitSet(pev->spawnflags, SF_DOOR_NO_AUTO_RETURN) && m_toggle_state == TS_AT_TOP) + if ( m_toggle_state == TS_AT_BOTTOM || ( FBitSet(pev->spawnflags, SF_DOOR_NO_AUTO_RETURN) && m_toggle_state == TS_AT_TOP ) ) DoorActivate(); } @@ -576,7 +576,7 @@ void CBaseDoor::DoorGoUp( void ) m_toggle_state = TS_GOING_UP; - SetMoveDone( &DoorHitTop ); + SetMoveDone( &CBaseDoor::DoorHitTop ); if ( FClassnameIs(pev, "func_door_rotating")) // !!! BUGBUG Triggered doors don't work with this yet { 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( &CBaseDoor::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( &CBaseDoor::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( &CBaseDoor::DoorHitBottom ); if ( FClassnameIs(pev, "func_door_rotating"))//rotating door AngularMove( m_vecAngle1, pev->speed); else @@ -688,7 +688,7 @@ void CBaseDoor::DoorHitBottom( void ) SetTouch( NULL ); } else // touchable door - SetTouch( &DoorTouch ); + SetTouch( &CBaseDoor::DoorTouch ); SUB_UseTargets( m_hActivator, USE_TOGGLE, 0 ); // this isn't finished @@ -865,7 +865,7 @@ void CRotDoor::Spawn( void ) SetTouch( NULL ); } else // touchable button - SetTouch( &DoorTouch ); + SetTouch( &CBaseDoor::DoorTouch ); } @@ -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( &CMomentaryDoor::MomentaryMoveDone ); } } @@ -1084,4 +1084,4 @@ void CMomentaryDoor::MomentaryMoveDone( void ) { STOP_SOUND(ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseMoving)); EMIT_SOUND(ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseArrived), 1, ATTN_NORM); -} \ No newline at end of file +} diff --git a/dlls/effects.cpp b/dlls/effects.cpp index 933e952e..9868aeb9 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( &CBubbling::FizzThink ); pev->nextthink = gpGlobals->time + 2.0; m_state = 1; } @@ -108,7 +108,7 @@ void CBubbling::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use if ( m_state ) { - SetThink( &FizzThink ); + SetThink( &CBubbling::FizzThink ); pev->nextthink = gpGlobals->time + 0.1; } else @@ -459,7 +459,7 @@ void CLightning::Spawn( void ) { if ( FStringNull( m_iszSpriteName ) ) { - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); return; } pev->solid = SOLID_NOT; // Remove model & collisions @@ -472,7 +472,7 @@ void CLightning::Spawn( void ) SetThink( NULL ); if ( pev->dmg > 0 ) { - SetThink( &DamageThink ); + SetThink( &CLightning::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( &CLightning::ToggleUse ); } } else @@ -494,11 +494,11 @@ void CLightning::Spawn( void ) m_active = 0; if ( !FStringNull(pev->targetname) ) { - SetUse( &StrikeUse ); + SetUse( &CLightning::StrikeUse ); } if ( FStringNull(pev->targetname) || FBitSet(pev->spawnflags, SF_BEAM_STARTON) ) { - SetThink( &StrikeThink ); + SetThink( &CLightning::StrikeThink ); pev->nextthink = gpGlobals->time + 1.0; } } @@ -616,7 +616,7 @@ void CLightning::StrikeUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T } else { - SetThink( &StrikeThink ); + SetThink( &CLightning::StrikeThink ); pev->nextthink = gpGlobals->time + 0.1; } @@ -961,13 +961,13 @@ void CLaser::Spawn( void ) { if ( FStringNull( pev->model ) ) { - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); return; } pev->solid = SOLID_NOT; // Remove model & collisions Precache( ); - SetThink( &StrikeThink ); + SetThink( &CLaser::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( &CSprite::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( &CSprite::CSprite::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( &CGibShooter::ShootThink ); pev->nextthink = gpGlobals->time; } @@ -1516,7 +1516,7 @@ void CGibShooter :: ShootThink ( void ) } else { - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time; } } @@ -1708,7 +1708,7 @@ void CTestEffect::TestThink( void ) void CTestEffect::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { - SetThink( &TestThink ); + SetThink( &CTestEffect::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( &CBaseEntity::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( &CItemSoda::CanThink); pev->nextthink = gpGlobals->time + 0.5; } @@ -2239,7 +2239,7 @@ void CItemSoda::CanThink ( void ) pev->solid = SOLID_TRIGGER; UTIL_SetSize ( pev, Vector ( -8, -8, 0 ), Vector ( 8, 8, 8 ) ); SetThink( NULL ); - SetTouch( &CanTouch ); + SetTouch( &CItemSoda::CanTouch ); } void CItemSoda::CanTouch ( CBaseEntity *pOther ) @@ -2263,6 +2263,6 @@ void CItemSoda::CanTouch ( CBaseEntity *pOther ) pev->movetype = MOVETYPE_NONE; pev->effects = EF_NODRAW; SetTouch( NULL ); - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time; -} \ No newline at end of file +} diff --git a/dlls/effects.h b/dlls/effects.h index c62a3ee4..c95ff1b1 100644 --- a/dlls/effects.h +++ b/dlls/effects.h @@ -79,7 +79,7 @@ public: inline void AnimateAndDie( float framerate ) { - SetThink( &AnimateUntilDead); + SetThink( &CSprite::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( &CBaseEntity::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 2427d108..c884fa54 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( &CEnvExplosion::Smoke ); pev->nextthink = gpGlobals->time + 0.3; // draw sparks diff --git a/dlls/func_break.cpp b/dlls/func_break.cpp index b1cad808..5d682dcb 100644 --- a/dlls/func_break.cpp +++ b/dlls/func_break.cpp @@ -164,7 +164,7 @@ void CBreakable::Spawn( void ) SET_MODEL(ENT(pev), STRING(pev->model) );//set size and link into world. - SetTouch( &BreakTouch ); + SetTouch( &CBreakable::BreakTouch ); if ( FBitSet( pev->spawnflags, SF_BREAK_TRIGGER_ONLY ) ) // Only break on trigger SetTouch( NULL ); @@ -359,7 +359,7 @@ void CBreakable::DamageSound( void ) int pitch; float fvol; char *rgpsz[6]; - int i; + int i = 0; int material = m_Material; // if (RANDOM_LONG(0,1)) @@ -459,7 +459,7 @@ void CBreakable::BreakTouch( CBaseEntity *pOther ) // play creaking sound here. DamageSound(); - SetThink( &Die ); + SetThink( &CBreakable::Die ); SetTouch( NULL ); if ( m_flDelay == 0 ) @@ -743,7 +743,7 @@ void CBreakable::Die( void ) // Fire targets on break SUB_UseTargets( NULL, USE_TOGGLE, 0 ); - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = pev->ltime + 0.1; if ( m_iszSpawnObject ) CBaseEntity::Create( (char *)STRING(m_iszSpawnObject), VecBModelOrigin(pev), pev->angles, edict() ); diff --git a/dlls/gargantua.cpp b/dlls/gargantua.cpp index ffe60c6b..3dc763da 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( &CBaseEntity::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( &CBaseEntity::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( &CBaseEntity::SUB_FadeOut ); } MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); WRITE_BYTE( TE_BREAKMODEL); @@ -1365,4 +1365,4 @@ void SpawnExplosion( Vector center, float randomRange, float time, int magnitude -#endif \ No newline at end of file +#endif diff --git a/dlls/ggrenade.cpp b/dlls/ggrenade.cpp index c811207b..6cf34576 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( &CGrenade::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( &CGrenade::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( &CGrenade::Detonate ); pev->nextthink = gpGlobals->time + 1; } @@ -331,7 +331,7 @@ void CGrenade :: TumbleThink( void ) if (pev->dmgtime <= gpGlobals->time) { - SetThink( &Detonate ); + SetThink( &CGrenade::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( &CGrenade::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( &CGrenade::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( &CGrenade::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( &CGrenade::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( &CBaseEntity::SUB_DoNothing ); + pGrenade->SetUse( &CGrenade::DetonateUse ); + pGrenade->SetTouch( &CGrenade::SlideTouch ); pGrenade->pev->spawnflags = SF_DETONATE; pGrenade->pev->friction = 0.9; diff --git a/dlls/h_battery.cpp b/dlls/h_battery.cpp index 68c97bd1..b8a3e7b0 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( &CRecharge::Off); // Time to recharge yet? @@ -179,7 +179,7 @@ void CRecharge::Recharge(void) { m_iJuice = gSkillData.suitchargerCapacity; pev->frame = 0; - SetThink( &SUB_DoNothing ); + SetThink( &CBaseEntity::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( &CRecharge::Recharge); } else - SetThink( &SUB_DoNothing ); -} \ No newline at end of file + SetThink( &CBaseEntity::SUB_DoNothing ); +} diff --git a/dlls/h_cine.cpp b/dlls/h_cine.cpp index def27354..d25902a2 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( &CLegacyCineMonster::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( &CLegacyCineMonster::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( &CBaseEntity::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( &CCineBlood::BloodGush ); pev->nextthink = gpGlobals->time;// now! } void CCineBlood :: Spawn ( void ) { pev->solid = SOLID_NOT; - SetUse( &BloodStart ); + SetUse( &CCineBlood::BloodStart ); pev->health = 20;//hacked health to count iterations } diff --git a/dlls/h_cycler.cpp b/dlls/h_cycler.cpp index d823488e..e7d5109b 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( &CBasePlayerItem::DefaultTouch ); } diff --git a/dlls/handgrenade.cpp b/dlls/handgrenade.cpp index 2233b8a0..56ce9ee6 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 6f43965c..8796769a 100644 --- a/dlls/headcrab.cpp +++ b/dlls/headcrab.cpp @@ -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( &CHeadCrab::LeapTouch ); break; } default: diff --git a/dlls/healthkit.cpp b/dlls/healthkit.cpp index fbf1d982..87b9a221 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( &CWallHealth::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( &CBaseEntity::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( &CWallHealth::Recharge ); } else - SetThink( &SUB_DoNothing ); -} \ No newline at end of file + SetThink( &CBaseEntity::SUB_DoNothing ); +} diff --git a/dlls/hgrunt.cpp b/dlls/hgrunt.cpp index eab06752..86544534 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( &CHGruntRepel::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( &CBaseEntity::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 f11dfb7f..5e64f4ef 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( &CHornet::DieTouch ); + SetThink( &CHornet::StartTrack ); edict_t *pSoundEnt = pev->owner; if ( !pSoundEnt ) @@ -169,8 +169,8 @@ void CHornet :: StartTrack ( void ) { IgniteTrail(); - SetTouch( &TrackTouch ); - SetThink( &TrackTarget ); + SetTouch( &CHornet::TrackTouch ); + SetThink( &CHornet::TrackTarget ); pev->nextthink = gpGlobals->time + 0.1; } @@ -182,9 +182,9 @@ void CHornet :: StartDart ( void ) { IgniteTrail(); - SetTouch( &DartTouch ); + SetTouch( &CHornet::DartTouch ); - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time + 4; } @@ -257,7 +257,7 @@ void CHornet :: TrackTarget ( void ) if (gpGlobals->time > m_flStopAttack) { SetTouch( NULL ); - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::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( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time + 1;// stick around long enough for the sound to finish! } diff --git a/dlls/houndeye.cpp b/dlls/houndeye.cpp index e8bfacfd..5b9e0126 100644 --- a/dlls/houndeye.cpp +++ b/dlls/houndeye.cpp @@ -97,7 +97,7 @@ public: BOOL FValidateHintType ( short sHint ); BOOL FCanActiveIdle ( void ); Schedule_t *GetScheduleOfType ( int Type ); - Schedule_t *CHoundeye :: GetSchedule( void ); + Schedule_t *GetSchedule( void ); int Save( CSave &save ); int Restore( CRestore &restore ); diff --git a/dlls/ichthyosaur.cpp b/dlls/ichthyosaur.cpp index fa62e613..f4cc3888 100644 --- a/dlls/ichthyosaur.cpp +++ b/dlls/ichthyosaur.cpp @@ -494,8 +494,8 @@ void CIchthyosaur :: Spawn() MonsterInit(); - SetTouch( &BiteTouch ); - SetUse( &CombatUse ); + SetTouch( &CIchthyosaur::BiteTouch ); + SetUse( &CIchthyosaur::CombatUse ); m_idealDist = 384; m_flMinSpeed = 80; @@ -1105,4 +1105,4 @@ Vector CIchthyosaur::DoProbe(const Vector &Probe) return Vector(0, 0, 0); } -#endif \ No newline at end of file +#endif diff --git a/dlls/items.cpp b/dlls/items.cpp index fe88a53e..930b187d 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( &CItem::ItemTouch ); if (DROP_TO_FLOOR(ENT(pev)) == 0) { @@ -151,7 +151,7 @@ CBaseEntity* CItem::Respawn( void ) UTIL_SetOrigin( pev, g_pGameRules->VecItemRespawnSpot( this ) );// blip to whereever you should respawn. - SetThink( &Materialize ); + SetThink( &CItem::Materialize ); pev->nextthink = g_pGameRules->FlItemRespawnTime( this ); return this; } @@ -166,7 +166,7 @@ void CItem::Materialize( void ) pev->effects |= EF_MUZZLEFLASH; } - SetTouch( &ItemTouch ); + SetTouch( &CItem::ItemTouch ); } #define SF_SUIT_SHORTLOGON 0x0001 diff --git a/dlls/leech.cpp b/dlls/leech.cpp index 6c13e08d..390588db 100644 --- a/dlls/leech.cpp +++ b/dlls/leech.cpp @@ -196,7 +196,7 @@ void CLeech::Spawn( void ) m_flFieldOfView = -0.5; // 180 degree FOV m_flDistLook = 750; MonsterInit(); - SetThink( &SwimThink ); + SetThink( &CLeech::SwimThink ); SetUse( NULL ); SetTouch( NULL ); pev->view_ofs = g_vecZero; @@ -717,7 +717,7 @@ void CLeech::Killed(entvars_t *pevAttacker, int iGib) pev->movetype = MOVETYPE_TOSS; pev->takedamage = DAMAGE_NO; - SetThink( &DeadThink ); + SetThink( &CLeech::DeadThink ); } diff --git a/dlls/monstermaker.cpp b/dlls/monstermaker.cpp index 43513d0a..72e44575 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( &CMonsterMaker::CyclicUse );// drop one monster each time we fire } else { - SetUse( &ToggleUse );// so can be turned on/off + SetUse( &CMonsterMaker::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( &CMonsterMaker::MakerThink ); } else {// wait to be activated. m_fActive = FALSE; - SetThink( &SUB_DoNothing ); + SetThink( &CBaseEntity::SUB_DoNothing ); } } else {// no targetname, just start. pev->nextthink = gpGlobals->time + m_flDelay; m_fActive = TRUE; - SetThink( &MakerThink ); + SetThink( &CMonsterMaker::MakerThink ); } if ( m_cNumMonsters == 1 ) @@ -259,7 +259,7 @@ void CMonsterMaker :: ToggleUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, else { m_fActive = TRUE; - SetThink( &MakerThink ); + SetThink( &CMonsterMaker::MakerThink ); } pev->nextthink = gpGlobals->time; diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index ad64189d..1e6191d1 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -2044,9 +2044,9 @@ void CBaseMonster :: MonsterInit ( void ) // set eye position SetEyePosition(); - SetThink( &MonsterInitThink ); + SetThink( &CBaseMonster::MonsterInitThink ); pev->nextthink = gpGlobals->time + 0.1; - SetUse( &MonsterUse ); + SetUse( &CBaseMonster::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( &CBaseMonster::CallMonsterThink ); pev->nextthink += RANDOM_FLOAT(0.1, 0.4); // spread think times. if ( !FStringNull(pev->targetname) )// wait until triggered @@ -3289,7 +3289,7 @@ void CBaseMonster :: MonsterInitDead( void ) // Setup health counters, etc. BecomeDead(); - SetThink( &CorpseFallThink ); + SetThink( &CBaseMonster::CorpseFallThink ); pev->nextthink = gpGlobals->time + 0.5; } diff --git a/dlls/mortar.cpp b/dlls/mortar.cpp index d1d64825..e9e47630 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( &CFuncMortarField::FieldUse ); Precache(); } @@ -209,7 +209,7 @@ void CMortar::Spawn( ) pev->dmg = 200; - SetThink( &MortarExplode ); + SetThink( &CMortar::MortarExplode ); pev->nextthink = 0; Precache( ); @@ -320,4 +320,4 @@ void CMortar::ShootTimed( EVARS *pevOwner, Vector vecStart, float time ) UTIL_SetOrigin( pMortar->pev, tr.vecEndPos ); } -#endif \ No newline at end of file +#endif diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 2e2cab75..fb3d3e18 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -563,7 +563,7 @@ void CHalfLifeMultiplay :: PlayerSpawn( CBasePlayer *pPlayer ) addDefault = TRUE; - while ( pWeaponEntity = UTIL_FindEntityByClassname( pWeaponEntity, "game_player_equip" )) + while ( ( pWeaponEntity = UTIL_FindEntityByClassname( pWeaponEntity, "game_player_equip" ) ) ) { pWeaponEntity->Touch( pPlayer ); addDefault = FALSE; diff --git a/dlls/nihilanth.cpp b/dlls/nihilanth.cpp index 8e7859eb..9456fad7 100644 --- a/dlls/nihilanth.cpp +++ b/dlls/nihilanth.cpp @@ -300,7 +300,7 @@ void CNihilanth :: Spawn( void ) InitBoneControllers(); - SetThink( &StartupThink ); + SetThink( &CNihilanth::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( &CNihilanth::HuntThink ); pev->nextthink = gpGlobals->time + 0.1; - SetUse( &CommandUse ); + SetUse( &CNihilanth::CommandUse ); } @@ -410,8 +410,8 @@ void CNihilanth::StartupThink( void ) } m_hRecharger = NULL; - SetThink( &HuntThink); - SetUse( &CommandUse ); + SetThink( &CNihilanth::HuntThink); + SetUse( &CNihilanth::CommandUse ); pev->nextthink = gpGlobals->time + 0.1; } @@ -846,7 +846,7 @@ void CNihilanth :: HuntThink( void ) // if dead, force cancelation of current animation if (pev->health <= 0) { - SetThink( &DyingThink ); + SetThink( &CNihilanth::DyingThink ); m_fSequenceFinished = TRUE; return; } @@ -1018,8 +1018,9 @@ BOOL CNihilanth :: EmitSphere( void ) void CNihilanth :: TargetSphere( USE_TYPE useType, float value ) { + int i; CBaseMonster *pSphere; - for (int i = 0; i < N_SPHERES; i++) + for (i = 0; i < N_SPHERES; i++) { if (m_hSphere[i] != NULL) { @@ -1330,8 +1331,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( &CNihilanthHVR::HoverThink ); + SetTouch( &CNihilanthHVR::BounceTouch ); pev->nextthink = gpGlobals->time + 0.1; m_hTargetEnt = pTarget; @@ -1433,8 +1434,8 @@ void CNihilanthHVR :: ZapInit( CBaseEntity *pEnemy ) pev->velocity = (pEnemy->pev->origin - pev->origin).Normalize() * 200; m_hEnemy = pEnemy; - SetThink( &ZapThink ); - SetTouch( &ZapTouch ); + SetThink( &CNihilanthHVR::ZapThink ); + SetTouch( &CNihilanthHVR::ZapTouch ); pev->nextthink = gpGlobals->time + 0.1; EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "debris/zap4.wav", 1, ATTN_NORM, 0, 100 ); @@ -1559,8 +1560,8 @@ void CNihilanthHVR :: TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBa m_hTargetEnt = pTarget; m_hTouch = pTouch; - SetThink( &TeleportThink ); - SetTouch( &TeleportTouch ); + SetThink( &CNihilanthHVR::TeleportThink ); + SetTouch( &CNihilanthHVR::TeleportTouch ); pev->nextthink = gpGlobals->time + 0.1; EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "x/x_teleattack1.wav", 1, 0.2, 0, 100 ); @@ -1579,7 +1580,7 @@ void CNihilanthHVR :: GreenBallInit( ) SET_MODEL(edict(), "sprites/exit1.spr"); - SetTouch( &RemoveTouch ); + SetTouch( &CNihilanthHVR::RemoveTouch ); } @@ -1631,7 +1632,7 @@ void CNihilanthHVR :: TeleportThink( void ) void CNihilanthHVR :: AbsorbInit( void ) { - SetThink( &DissipateThink ); + SetThink( &CNihilanthHVR::DissipateThink ); pev->renderamt = 255; MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -1833,4 +1834,4 @@ void CNihilanthHVR::BounceTouch( CBaseEntity *pOther ) -#endif \ No newline at end of file +#endif diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index 1a55cd43..c69dc709 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -40,7 +40,7 @@ CGraph WorldGraph; LINK_ENTITY_TO_CLASS( info_node, CNodeEnt ); LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt ); -#ifdef __linux__ +#ifdef _LINUX #include #include #define CreateDirectory(p, n) mkdir(p, 0777) @@ -636,6 +636,7 @@ int CGraph :: FindShortestPath ( int *piPath, int iStart, int iDest, int iHull, } else { + int i; CQueuePriority queue; switch( iHull ) @@ -656,7 +657,7 @@ int CGraph :: FindShortestPath ( int *piPath, int iStart, int iDest, int iHull, // Mark all the nodes as unvisited. // - for ( int i = 0; i < m_cNodes; i++) + for ( i = 0; i < m_cNodes; i++) { m_pNodes[ i ].m_flClosestSoFar = -1.0; } @@ -888,7 +889,7 @@ int CGraph :: FindNearestNode ( const Vector &vecOrigin, int afNodeTypes ) m_CheckedCounter++; if (m_CheckedCounter == 0) { - for (int i = 0; i < m_cNodes; i++) + for ( i = 0; i < m_cNodes; i++ ) { m_di[i].m_CheckedEvent = 0; } @@ -1274,7 +1275,8 @@ int CGraph :: LinkVisibleNodes ( CLink *pLinkPool, FILE *file, int *piBadNode ) fprintf ( file, " Entity on connection: %s, name: %s Model: %s", STRING( VARS( pTraceEnt )->classname ), STRING ( VARS( pTraceEnt )->targetname ), STRING ( VARS(tr.pHit)->model ) ); } - fprintf ( file, "\n", j ); + //fprintf ( file, "\n", j ); + fprintf ( file, "\n" ); } pLinkPool [ cTotalLinks ].m_iDestNode = j; @@ -1459,12 +1461,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( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time; } else { - SetThink( &DropDelay ); + SetThink( &CTestHull::DropDelay ); pev->nextthink = gpGlobals->time + 1; } @@ -1484,7 +1486,7 @@ void CTestHull::DropDelay ( void ) UTIL_SetOrigin ( VARS(pev), WorldGraph.m_pNodes[ 0 ].m_vecOrigin ); - SetThink( &CallBuildNodeGraph ); + SetThink( &CTestHull::CallBuildNodeGraph ); pev->nextthink = gpGlobals->time + 1; } @@ -1593,7 +1595,7 @@ void CTestHull::CallBuildNodeGraph( void ) //========================================================= void CTestHull :: BuildNodeGraph( void ) { - TraceResult tr; + //TraceResult tr; FILE *file; char szNrpFilename [MAX_PATH];// text node report filename @@ -1632,7 +1634,7 @@ void CTestHull :: BuildNodeGraph( void ) float flDist; int step; - SetThink( &SUB_Remove );// no matter what happens, the hull gets rid of itself. + SetThink( &CBaseEntity::SUB_Remove );// no matter what happens, the hull gets rid of itself. pev->nextthink = gpGlobals->time; // malloc a swollen temporary connection pool that we trim down after we know exactly how many connections there are. @@ -1744,7 +1746,7 @@ void CTestHull :: BuildNodeGraph( void ) { ALERT ( at_aiconsole, "**ConnectVisibleNodes FAILED!\n" ); - SetThink( &ShowBadNode );// send the hull off to show the offending node. + SetThink( &CTestHull::ShowBadNode );// send the hull off to show the offending node. //pev->solid = SOLID_NOT; pev->origin = WorldGraph.m_pNodes[ iBadNode ].m_vecOrigin; @@ -1883,17 +1885,17 @@ void CTestHull :: BuildNodeGraph( void ) switch ( hull ) { case NODE_SMALL_HULL: // if this hull can't fit, nothing can, so drop the connection - fprintf ( file, "NODE_SMALL_HULL step %f\n", step ); + fprintf ( file, "NODE_SMALL_HULL step %d\n", step ); pTempPool[ pSrcNode->m_iFirstLink + j ].m_afLinkInfo &= ~(bits_LINK_SMALL_HULL | bits_LINK_HUMAN_HULL | bits_LINK_LARGE_HULL); fSkipRemainingHulls = TRUE;// don't bother checking larger hulls break; case NODE_HUMAN_HULL: - fprintf ( file, "NODE_HUMAN_HULL step %f\n", step ); + fprintf ( file, "NODE_HUMAN_HULL step %d\n", step ); pTempPool[ pSrcNode->m_iFirstLink + j ].m_afLinkInfo &= ~(bits_LINK_HUMAN_HULL | bits_LINK_LARGE_HULL); fSkipRemainingHulls = TRUE;// don't bother checking larger hulls break; case NODE_LARGE_HULL: - fprintf ( file, "NODE_LARGE_HULL step %f\n", step ); + fprintf ( file, "NODE_LARGE_HULL step %d\n", step ); pTempPool[ pSrcNode->m_iFirstLink + j ].m_afLinkInfo &= ~bits_LINK_LARGE_HULL; break; } @@ -2722,6 +2724,7 @@ int Primes[NUMBER_OF_PRIMES] = void CGraph::HashChoosePrimes(int TableSize) { + int iPrime, iZone; int LargestPrime = TableSize/2; if (LargestPrime > Primes[NUMBER_OF_PRIMES-2]) { @@ -2733,7 +2736,7 @@ void CGraph::HashChoosePrimes(int TableSize) // We divide this interval into 16 equal sized zones. We want to find // one prime number that best represents that zone. // - for (int iZone = 1, iPrime = 0; iPrime < 16; iZone += Spacing) + for ( iZone = 1, iPrime = 0; iPrime < 16; iZone += Spacing ) { // Search for a prime number that is less than the target zone // number given by iZone. @@ -2789,9 +2792,9 @@ void CGraph::SortNodes(void) // After assigning new node numbers to everything, we move // things and patchup the links. // - int iNodeCnt = 0; + int i, iNodeCnt = 0; m_pNodes[0].m_iPreviousNode = iNodeCnt++; - for (int i = 1; i < m_cNodes; i++) + for (i = 1; i < m_cNodes; i++) { m_pNodes[i].m_iPreviousNode = UNNUMBERED_NODE; } @@ -2847,6 +2850,7 @@ void CGraph::SortNodes(void) void CGraph::BuildLinkLookups(void) { + int i; m_nHashLinks = 3*m_cLinks/2 + 3; HashChoosePrimes(m_nHashLinks); @@ -2856,7 +2860,7 @@ void CGraph::BuildLinkLookups(void) ALERT(at_aiconsole, "Couldn't allocated Link Lookup Table.\n"); return; } - for (int i = 0; i < m_nHashLinks; i++) + for ( i = 0; i < m_nHashLinks; i++ ) { m_pHashLinks[i] = ENTRY_STATE_EMPTY; } @@ -2882,6 +2886,7 @@ void CGraph::BuildLinkLookups(void) void CGraph::BuildRegionTables(void) { + int i, j; if (m_di) free(m_di); // Go ahead and setup for range searching the nodes for FindNearestNodes @@ -2896,7 +2901,7 @@ void CGraph::BuildRegionTables(void) // Calculate regions for all the nodes. // // - for (int i = 0; i < 3; i++) + for ( i = 0; i < 3; i++ ) { m_RegionMin[i] = 999999999.0; // just a big number out there; m_RegionMax[i] = -999999999.0; // just a big number out there; @@ -2926,7 +2931,7 @@ void CGraph::BuildRegionTables(void) for (i = 0; i < 3; i++) { - for (int j = 0; j < NUM_RANGES; j++) + for (j = 0; j < NUM_RANGES; j++) { m_RangeStart[i][j] = 255; m_RangeEnd[i][j] = 0; @@ -3029,6 +3034,7 @@ void CGraph::BuildRegionTables(void) void CGraph :: ComputeStaticRoutingTables( void ) { + int iFrom; int nRoutes = m_cNodes*m_cNodes; #define FROM_TO(x,y) ((x)*m_cNodes+(y)) short *Routes = new short[nRoutes]; @@ -3060,7 +3066,7 @@ void CGraph :: ComputeStaticRoutingTables( void ) // Initialize Routing table to uncalculated. // - for (int iFrom = 0; iFrom < m_cNodes; iFrom++) + for (iFrom = 0; iFrom < m_cNodes; iFrom++) { for (int iTo = 0; iTo < m_cNodes; iTo++) { @@ -3276,7 +3282,8 @@ void CGraph :: ComputeStaticRoutingTables( void ) int nRoute = p - pRoute; if (m_pRouteInfo) { - for (int i = 0; i < m_nRouteInfo - nRoute; i++) + int i; + for (i = 0; i < m_nRouteInfo - nRoute; i++) { if (memcmp(m_pRouteInfo + i, pRoute, nRoute) == 0) { @@ -3312,10 +3319,10 @@ void CGraph :: ComputeStaticRoutingTables( void ) } ALERT( at_aiconsole, "Size of Routes = %d\n", nTotalCompressedSize); } - if (Routes) delete Routes; - if (BestNextNodes) delete BestNextNodes; - if (pRoute) delete pRoute; - if (pMyPath) delete pMyPath; + if ( Routes ) delete[] Routes; + if ( BestNextNodes ) delete[] BestNextNodes; + if ( pRoute ) delete[] pRoute; + if ( pMyPath ) delete[] pMyPath; Routes = 0; BestNextNodes = 0; pRoute = 0; @@ -3331,6 +3338,7 @@ void CGraph :: ComputeStaticRoutingTables( void ) // void CGraph :: TestRoutingTables( void ) { + int i; int *pMyPath = new int[m_cNodes]; int *pMyPath2 = new int[m_cNodes]; if (pMyPath && pMyPath2) @@ -3368,7 +3376,7 @@ void CGraph :: TestRoutingTables( void ) // #if 1 float flDistance1 = 0.0; - for (int i = 0; i < cPathSize1-1; i++) + for ( i = 0; i < cPathSize1-1; i++ ) { // Find the link from pMyPath[i] to pMyPath[i+1] // @@ -3422,7 +3430,7 @@ void CGraph :: TestRoutingTables( void ) #endif ALERT(at_aiconsole, "Routing is inconsistent!!!\n"); ALERT(at_aiconsole, "(%d to %d |%d/%d)1:", iFrom, iTo, iHull, iCap); - for (int i = 0; i < cPathSize1; i++) + for ( i = 0; i < cPathSize1; i++ ) { ALERT(at_aiconsole, "%d ", pMyPath[i]); } @@ -3446,8 +3454,8 @@ void CGraph :: TestRoutingTables( void ) EnoughSaid: - if (pMyPath) delete pMyPath; - if (pMyPath2) delete pMyPath2; + if (pMyPath) delete[] pMyPath; + if (pMyPath2) delete[] pMyPath2; pMyPath = 0; pMyPath2 = 0; } @@ -3559,7 +3567,7 @@ void CNodeViewer::Spawn( ) ALERT( at_aiconsole, "%d nodes\n", m_nVisited ); m_iDraw = 0; - SetThink( &DrawThink ); + SetThink( &CNodeViewer::DrawThink ); pev->nextthink = gpGlobals->time; } diff --git a/dlls/osprey.cpp b/dlls/osprey.cpp index b85fadda..309d4354 100644 --- a/dlls/osprey.cpp +++ b/dlls/osprey.cpp @@ -167,8 +167,8 @@ void COsprey :: Spawn( void ) InitBoneControllers(); - SetThink( &FindAllThink ); - SetUse( &CommandUse ); + SetThink( &COsprey::FindAllThink ); + SetUse( &COsprey::CommandUse ); if (!(pev->spawnflags & SF_WAITFORTRIGGER)) { @@ -225,7 +225,7 @@ void COsprey :: FindAllThink( void ) UTIL_Remove( this ); return; } - SetThink( &FlyThink ); + SetThink( &COsprey::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( &COsprey::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( &CBaseEntity::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( &COsprey::FlyThink ); } pev->nextthink = gpGlobals->time + 0.1; @@ -396,7 +396,7 @@ void COsprey::FlyThink( void ) { if (m_pGoalEnt->pev->speed == 0) { - SetThink( &DeployThink ); + SetThink( &COsprey::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( &COsprey::DyingThink ); + SetTouch( &COsprey::CrashTouch ); pev->nextthink = gpGlobals->time + 0.1; pev->health = 0; pev->takedamage = DAMAGE_NO; diff --git a/dlls/plats.cpp b/dlls/plats.cpp index 5b62d79b..64151f47 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( &CFuncPlat::PlatUse ); } else { @@ -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( &CFuncPlat::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( &CFuncPlat::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( &CFuncPlat::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( &CFuncTrain::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( &CFuncTrain::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( &CFuncTrain::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( &CFuncTrain::Next ); pev->nextthink = pev->ltime + 0.1; } } @@ -1126,7 +1126,7 @@ void CFuncTrackTrain :: UpdateSound( void ) if (!pev->noise) return; - flpitch = TRAIN_STARTPITCH + (abs(pev->speed) * (TRAIN_MAXPITCH - TRAIN_STARTPITCH) / TRAIN_MAXSPEED); + flpitch = TRAIN_STARTPITCH + (fabs(pev->speed) * (TRAIN_MAXPITCH - TRAIN_STARTPITCH) / TRAIN_MAXSPEED); if (!m_soundPlaying) { @@ -1262,7 +1262,7 @@ void CFuncTrackTrain :: Next( void ) } } - SetThink( &Next ); + SetThink( &CFuncTrackTrain::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( &CFuncTrackTrain::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( &CFuncTrackTrain::Next ); pev->speed = m_startSpeed; UpdateSound(); @@ -1452,7 +1452,7 @@ void CFuncTrackTrain :: NearestPath( void ) if ( pev->speed != 0 ) { NextThink( pev->ltime + 0.1, FALSE ); - SetThink( &Next ); + SetThink( &CFuncTrackTrain::Next ); } } @@ -1460,7 +1460,7 @@ void CFuncTrackTrain :: NearestPath( void ) void CFuncTrackTrain::OverrideReset( void ) { NextThink( pev->ltime + 0.1, FALSE ); - SetThink( &NearestPath ); + SetThink( &CFuncTrackTrain::NearestPath ); } @@ -1519,7 +1519,7 @@ void CFuncTrackTrain :: Spawn( void ) // start trains on the next frame, to make sure their targets have had // a chance to spawn/activate NextThink( pev->ltime + 0.1, FALSE ); - SetThink( &Find ); + SetThink( &CFuncTrackTrain::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( &CFuncTrainControls::Find ); pev->nextthink = gpGlobals->time; } @@ -1701,7 +1701,7 @@ void CFuncTrackChange :: Spawn( void ) EnableUse(); pev->nextthink = pev->ltime + 2.0; - SetThink( &Find ); + SetThink( &CFuncTrackChange::Find ); Precache(); } @@ -1752,7 +1752,7 @@ void CFuncTrackChange :: KeyValue( KeyValueData *pkvd ) void CFuncTrackChange::OverrideReset( void ) { pev->nextthink = pev->ltime + 1.0; - SetThink( &Find ); + SetThink( &CFuncTrackChange::Find ); } void CFuncTrackChange :: Find( void ) @@ -1862,14 +1862,14 @@ void CFuncTrackChange :: GoDown( void ) // If ROTMOVE, move & rotate if ( FBitSet( pev->spawnflags, SF_TRACK_DONT_MOVE ) ) { - SetMoveDone( &CallHitBottom ); + SetMoveDone( &CFuncPlat::CallHitBottom ); m_toggle_state = TS_GOING_DOWN; AngularMove( m_start, pev->speed ); } else { CFuncPlat :: GoDown(); - SetMoveDone( &CallHitBottom ); + SetMoveDone( &CFuncPlat::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( &CFuncPlat::CallHitTop ); AngularMove( m_end, pev->speed ); } else { // If ROTMOVE, move & rotate CFuncPlat :: GoUp(); - SetMoveDone( &CallHitTop ); + SetMoveDone( &CFuncPlat::CallHitTop ); RotMove( m_end, pev->nextthink - pev->ltime ); } @@ -2160,7 +2160,7 @@ void CGunTarget::Spawn( void ) if ( pev->spawnflags & FGUNTARGET_START_ON ) { - SetThink( &Start ); + SetThink( &CGunTarget::Start ); pev->nextthink = pev->ltime + 0.3; } } @@ -2198,7 +2198,7 @@ void CGunTarget::Next( void ) Stop(); return; } - SetMoveDone( &Wait ); + SetMoveDone( &CGunTarget::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( &CGunTarget::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 8ff7a395..7dee887d 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -933,7 +933,7 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib ) pev->angles.x = 0; pev->angles.z = 0; - SetThink( &PlayerDeathThink); + SetThink( &CBasePlayer::PlayerDeathThink); pev->nextthink = gpGlobals->time + 0.1; } @@ -1979,7 +1979,7 @@ void CBasePlayer::CheckTimeBasedDamage() return; // only check for time based damage approx. every 2 seconds - if (abs(gpGlobals->time - m_tbdPrev) < 2.0) + if ( fabs( gpGlobals->time - m_tbdPrev ) < 2.0 ) return; m_tbdPrev = gpGlobals->time; @@ -2200,7 +2200,7 @@ void CBasePlayer::CheckSuitUpdate() // play a sentence off of the end of the queue for (i = 0; i < CSUITPLAYLIST; i++) { - if (isentence = m_rgSuitPlayList[isearch]) + if ( ( isentence = m_rgSuitPlayList[isearch] ) ) break; if (++isearch == CSUITPLAYLIST) @@ -3209,7 +3209,7 @@ void CBloodSplat::Spawn ( entvars_t *pevOwner ) pev->angles = pevOwner->v_angle; pev->owner = ENT(pevOwner); - SetThink( &Spray ); + SetThink( &CBloodSplat::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( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time + 0.1; } @@ -3537,7 +3537,7 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse ) case 107: { - TraceResult tr; + //TraceResult tr; edict_t *pWorld = g_engfuncs.pfnPEntityOfEntIndex( 0 ); @@ -3587,7 +3587,7 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse ) if ( pEntity ) { if ( pEntity->pev->takedamage ) - pEntity->SetThink( &SUB_Remove); + pEntity->SetThink( &CBaseEntity::SUB_Remove); } break; } @@ -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( &CRevertSaved::MessageThink ); } @@ -4737,7 +4737,7 @@ void CRevertSaved :: MessageThink( void ) if ( nextThink > 0 ) { pev->nextthink = gpGlobals->time + nextThink; - SetThink( &LoadThink ); + SetThink( &CRevertSaved::LoadThink ); } else LoadThink(); diff --git a/dlls/player.h b/dlls/player.h index cbf95809..56e535fb 100644 --- a/dlls/player.h +++ b/dlls/player.h @@ -292,7 +292,7 @@ public: void SetCustomDecalFrames( int nFrames ); int GetCustomDecalFrames( void ); - void CBasePlayer::TabulateAmmo( void ); + void TabulateAmmo( void ); float m_flStartCharge; float m_flAmmoStartCharge; diff --git a/dlls/roach.cpp b/dlls/roach.cpp index 3c13bf1c..32ec66ae 100644 --- a/dlls/roach.cpp +++ b/dlls/roach.cpp @@ -262,7 +262,7 @@ void CRoach :: MonsterThink( void ) pSound = CSoundEnt::SoundPointerForIndex( m_iAudibleList ); // roach smells food and is just standing around. Go to food unless food isn't on same z-plane. - if ( pSound && abs( pSound->m_vecOrigin.z - pev->origin.z ) <= 3 ) + if ( pSound && fabs( pSound->m_vecOrigin.z - pev->origin.z ) <= 3.0 ) { PickNewDest( ROACH_SMELL_FOOD ); SetActivity ( ACT_WALK ); diff --git a/dlls/rpg.cpp b/dlls/rpg.cpp index e13af4ab..b435b5cb 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( &CLaserSpot::Revive ); pev->nextthink = gpGlobals->time + flSuspendTime; } @@ -133,8 +133,8 @@ void CRpgRocket :: Spawn( void ) pev->classname = MAKE_STRING("rpg_rocket"); - SetThink( &IgniteThink ); - SetTouch( &ExplodeTouch ); + SetThink( &CRpgRocket::IgniteThink ); + SetTouch( &CGrenade::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( &CRpgRocket::FollowThink ); pev->nextthink = gpGlobals->time + 0.1; } @@ -284,7 +284,7 @@ void CRpgRocket :: FollowThink( void ) void CRpg::Reload( void ) { - int iResult; + int iResult = 0; if ( m_iClip == 1 ) { @@ -615,4 +615,4 @@ class CRpgAmmo : public CBasePlayerAmmo }; LINK_ENTITY_TO_CLASS( ammo_rpgclip, CRpgAmmo ); -#endif \ No newline at end of file +#endif diff --git a/dlls/satchel.cpp b/dlls/satchel.cpp index 0bd6513d..9eeb1abb 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( &CSatchelCharge::SatchelSlide ); + SetUse( &CGrenade::DetonateUse ); + SetThink( &CSatchelCharge::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; } } @@ -491,4 +491,4 @@ void DeactivateSatchels( CBasePlayer *pOwner ) } } -#endif \ No newline at end of file +#endif diff --git a/dlls/saverestore.h b/dlls/saverestore.h index 3814aaaf..c774b62d 100644 --- a/dlls/saverestore.h +++ b/dlls/saverestore.h @@ -60,7 +60,7 @@ public: void WriteVector( const char *pname, const float *value, int count ); // Save a vector void WritePositionVector( const char *pname, const Vector &value ); // Offset for landmark if necessary void WritePositionVector( const char *pname, const float *value, int count ); // array of pos vectors - void WriteFunction( const char *pname, void **value, int count ); // Save a function pointer + void WriteFunction( const char *pname, const int *value, int count ); // Save a function pointer int WriteEntVars( const char *pname, entvars_t *pev ); // Save entvars_t (entvars_t) int WriteFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ); diff --git a/dlls/scientist.cpp b/dlls/scientist.cpp index 5b1742b3..f7e991ad 100644 --- a/dlls/scientist.cpp +++ b/dlls/scientist.cpp @@ -686,7 +686,7 @@ void CScientist :: Spawn( void ) pev->skin = 1; MonsterInit(); - SetUse( &FollowerUse ); + SetUse( &CTalkMonster::FollowerUse ); } //========================================================= @@ -1012,7 +1012,7 @@ MONSTERSTATE CScientist :: GetIdealState ( void ) if ( IsFollowing() ) { int relationship = IRelationship( m_hEnemy ); - if ( relationship != R_FR || relationship != R_HT && !HasConditions( bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE ) ) + if ( relationship != R_FR || ( relationship != R_HT && !HasConditions( bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE ) ) ) { // Don't go to combat if you're following the player m_IdealMonsterState = MONSTERSTATE_ALERT; @@ -1240,7 +1240,7 @@ void CSittingScientist :: Spawn( ) pev->sequence = m_baseSequence + RANDOM_LONG(0,4); ResetSequenceInfo( ); - SetThink( &SittingThink); + SetThink( &CSittingScientist::SittingThink); pev->nextthink = gpGlobals->time + 0.1; DROP_TO_FLOOR ( ENT(pev) ); diff --git a/dlls/scripted.cpp b/dlls/scripted.cpp index 817e1f79..fbe56fd9 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( &CCineMonster::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( &CCineMonster::CineThink ); pev->nextthink = gpGlobals->time; } } @@ -253,7 +253,7 @@ void CCineMonster :: Touch( CBaseEntity *pOther ) // void CCineMonster :: Die( void ) { - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); } // @@ -564,7 +564,7 @@ void CCineMonster :: SequenceDone ( CBaseMonster *pMonster ) if ( !( pev->spawnflags & SF_SCRIPT_REPEATABLE ) ) { - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time + 0.1; } @@ -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( &CScriptedSentence::FindThink ); pev->nextthink = gpGlobals->time; } @@ -1039,7 +1039,7 @@ void CScriptedSentence :: Spawn( void ) // if no targetname, start now if ( !pev->targetname ) { - SetThink( &FindThink ); + SetThink( &CScriptedSentence::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( &CScriptedSentence::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( &CScriptedSentence::FindThink ); } @@ -1219,7 +1219,7 @@ LINK_ENTITY_TO_CLASS( monster_furniture, CFurniture ); //========================================================= void CFurniture :: Die ( void ) { - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time; } diff --git a/dlls/sound.cpp b/dlls/sound.cpp index 01038247..f61086a5 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( &CBaseEntity::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( &CAmbientGeneric::RampThink); pev->nextthink = 0; // allow on/off switching via 'use' function. - SetUse( &ToggleUse ); + SetUse( &CAmbientGeneric::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( &CBaseEntity::SUB_Remove ); return; } pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; - SetThink( &SpeakerThink); + SetThink( &CSpeaker::SpeakerThink); pev->nextthink = 0.0; // allow on/off switching via 'use' function. - SetUse( &ToggleUse ); + SetUse( &CSpeaker::ToggleUse ); Precache( ); } @@ -1975,4 +1975,4 @@ void CSpeaker :: KeyValue( KeyValueData *pkvd ) } else CBaseEntity::KeyValue( pkvd ); -} \ No newline at end of file +} diff --git a/dlls/soundent.cpp b/dlls/soundent.cpp index 93c70a7e..c3d169f1 100644 --- a/dlls/soundent.cpp +++ b/dlls/soundent.cpp @@ -274,7 +274,7 @@ void CSoundEnt :: Initialize ( void ) int CSoundEnt :: ISoundsInList ( int iListType ) { int i; - int iThisSound; + int iThisSound = 0; if ( iListType == SOUNDLISTTYPE_FREE ) { @@ -376,4 +376,4 @@ int CSoundEnt :: ClientSoundIndex ( edict_t *pClient ) #endif // _DEBUG return iReturn; -} \ No newline at end of file +} diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index 0eacb2d8..5dd718a4 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( &CSqueakGrenade::SuperBounceTouch ); + SetThink( &CSqueakGrenade::HuntThink ); pev->nextthink = gpGlobals->time + 0.1; m_flNextHunt = gpGlobals->time + 1E6; @@ -162,7 +162,7 @@ void CSqueakGrenade::Precache( void ) void CSqueakGrenade :: Killed( entvars_t *pevAttacker, int iGib ) { pev->model = iStringNull;// make invisible - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); SetTouch( NULL ); pev->nextthink = gpGlobals->time + 0.1; @@ -230,7 +230,7 @@ void CSqueakGrenade::HuntThink( void ) pev->velocity = pev->velocity * 0.9; pev->velocity.z += 8.0; } - else if (pev->movetype = MOVETYPE_FLY) + else if ( ( pev->movetype = MOVETYPE_FLY ) ) { pev->movetype = MOVETYPE_BOUNCE; } @@ -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; } @@ -598,4 +598,4 @@ void CSqueak::WeaponIdle( void ) SendWeaponAnim( iAnim ); } -#endif \ No newline at end of file +#endif diff --git a/dlls/subs.cpp b/dlls/subs.cpp index b48fc0f4..3de64d9a 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( &CBaseDelay::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( &CBaseToggle::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( &CBaseToggle::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 76ac05b7..ee0b0407 100644 --- a/dlls/talkmonster.cpp +++ b/dlls/talkmonster.cpp @@ -654,7 +654,7 @@ CBaseEntity *CTalkMonster::EnumFriends( CBaseEntity *pPrevious, int listNumber, Vector vecCheck; pszFriend = m_szFriends[ FriendNumber(listNumber) ]; - while (pFriend = UTIL_FindEntityByClassname( pFriend, pszFriend )) + while ( ( pFriend = UTIL_FindEntityByClassname( pFriend, pszFriend ) ) ) { if (pFriend == this || !pFriend->IsAlive()) // don't talk to self or dead people @@ -687,7 +687,7 @@ void CTalkMonster::AlertFriends( void ) // for each friend in this bsp... for ( i = 0; i < TLK_CFRIENDS; i++ ) { - while (pFriend = EnumFriends( pFriend, i, TRUE )) + while ( ( pFriend = EnumFriends( pFriend, i, TRUE ) ) ) { CBaseMonster *pMonster = pFriend->MyMonsterPointer(); if ( pMonster->IsAlive() ) @@ -709,7 +709,7 @@ void CTalkMonster::ShutUpFriends( void ) // for each friend in this bsp... for ( i = 0; i < TLK_CFRIENDS; i++ ) { - while (pFriend = EnumFriends( pFriend, i, TRUE )) + while ( ( pFriend = EnumFriends( pFriend, i, TRUE ) ) ) { CBaseMonster *pMonster = pFriend->MyMonsterPointer(); if ( pMonster ) @@ -732,7 +732,7 @@ void CTalkMonster::LimitFollowers( CBaseEntity *pPlayer, int maxFollowers ) // for each friend in this bsp... for ( i = 0; i < TLK_CFRIENDS; i++ ) { - while (pFriend = EnumFriends( pFriend, i, FALSE )) + while ( ( pFriend = EnumFriends( pFriend, i, FALSE ) ) ) { CBaseMonster *pMonster = pFriend->MyMonsterPointer(); if ( pMonster ) @@ -831,7 +831,7 @@ CBaseEntity *CTalkMonster :: FindNearestFriend(BOOL fPlayer) continue; // for each friend in this bsp... - while (pFriend = UTIL_FindEntityByClassname( pFriend, pszFriend )) + while ( ( pFriend = UTIL_FindEntityByClassname( pFriend, pszFriend ) ) ) { if (pFriend == this || !pFriend->IsAlive()) // don't talk to self or dead people @@ -1119,7 +1119,7 @@ int CTalkMonster :: FIdleSpeak ( void ) if ( RANDOM_LONG(0,1) ) { //SENTENCEG_PlayRndSz( ENT(pev), szIdleGroup, 1.0, ATTN_IDLE, 0, pitch ); - CBaseEntity *pFriend = FindNearestFriend(TRUE); + pFriend = FindNearestFriend(TRUE); if ( pFriend ) { diff --git a/dlls/tempmonster.cpp b/dlls/tempmonster.cpp index 2ad893f1..1f2cd7ed 100644 --- a/dlls/tempmonster.cpp +++ b/dlls/tempmonster.cpp @@ -114,4 +114,4 @@ void CMyMonster :: Precache() //========================================================= // AI Schedules Specific to this monster //========================================================= -#endif 0 +#endif //0 diff --git a/dlls/tentacle.cpp b/dlls/tentacle.cpp index 921a7b7d..016e850f 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( &CTentacle::Start ); + SetTouch( &CTentacle::HitTouch ); + SetUse( &CTentacle::CommandUse ); pev->nextthink = gpGlobals->time + 0.2; @@ -714,7 +714,7 @@ void CTentacle::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T { case USE_OFF: pev->takedamage = DAMAGE_NO; - SetThink( &DieThink ); + SetThink( &CTentacle::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( &CTentacle::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( &CTentacle::Cycle ); if ( !g_fFlySound ) { @@ -1041,4 +1041,4 @@ void CTentacleMaw :: Precache( ) PRECACHE_MODEL("models/maw.mdl"); } -#endif \ No newline at end of file +#endif diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index d7c82806..871a1ecc 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( &CFrictionModifier::ChangeFriction ); } @@ -344,8 +344,8 @@ void CMultiManager :: KeyValue( KeyValueData *pkvd ) void CMultiManager :: Spawn( void ) { pev->solid = SOLID_NOT; - SetUse( &ManagerUse ); - SetThink( &ManagerThink); + SetUse( &CMultiManager::ManagerUse ); + SetThink( &CMultiManager::ManagerThink ); // Sort targets // Quick and dirty bubble sort @@ -403,7 +403,7 @@ void CMultiManager :: ManagerThink ( void ) UTIL_Remove( this ); return; } - SetUse( &ManagerUse );// allow manager re-use + SetUse( &CMultiManager::ManagerUse );// allow manager re-use } else pev->nextthink = m_startTime + m_flTargetDelay[ m_index ]; @@ -444,7 +444,7 @@ void CMultiManager :: ManagerUse ( CBaseEntity *pActivator, CBaseEntity *pCaller SetUse( NULL );// disable use until all targets have fired - SetThink( &ManagerThink ); + SetThink( &CMultiManager::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( &CBaseTrigger::ToggleUse ); } } @@ -808,11 +808,11 @@ void CTargetCDAudio::Play( void ) void CTriggerHurt :: Spawn( void ) { InitTrigger(); - SetTouch( &HurtTouch ); + SetTouch( &CBaseTrigger::HurtTouch ); if ( !FStringNull ( pev->targetname ) ) { - SetUse( &ToggleUse ); + SetUse( &CBaseTrigger::ToggleUse ); } else { @@ -821,7 +821,7 @@ void CTriggerHurt :: Spawn( void ) if (m_bitsDamageInflict & DMG_RADIATION) { - SetThink( &RadiationThink ); + SetThink( &CTriggerHurt::RadiationThink ); pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5); } @@ -1080,7 +1080,7 @@ void CTriggerMultiple :: Spawn( void ) // } // else { - SetTouch( &MultiTouch ); + SetTouch( &CBaseTrigger::MultiTouch ); } } @@ -1122,7 +1122,7 @@ void CBaseTrigger :: MultiTouch( CBaseEntity *pOther ) // Only touch clients, monsters, or pushables (depending on flags) if ( ((pevToucher->flags & FL_CLIENT) && !(pev->spawnflags & SF_TRIGGER_NOCLIENTS)) || ((pevToucher->flags & FL_MONSTER) && (pev->spawnflags & SF_TRIGGER_ALLOWMONSTERS)) || - (pev->spawnflags & SF_TRIGGER_PUSHABLES) && FClassnameIs(pevToucher,"func_pushable") ) + ( ( pev->spawnflags & SF_TRIGGER_PUSHABLES ) && FClassnameIs( pevToucher,"func_pushable" ) ) ) { #if 0 @@ -1177,7 +1177,7 @@ void CBaseTrigger :: ActivateMultiTrigger( CBaseEntity *pActivator ) if (m_flWait > 0) { - SetThink( &MultiWaitOver ); + SetThink( &CBaseTrigger::MultiWaitOver ); pev->nextthink = gpGlobals->time + m_flWait; } else @@ -1186,7 +1186,7 @@ void CBaseTrigger :: ActivateMultiTrigger( CBaseEntity *pActivator ) // called while C code is looping through area links... SetTouch( NULL ); pev->nextthink = gpGlobals->time + 0.1; - SetThink( &SUB_Remove ); + SetThink( &CBaseEntity::SUB_Remove ); } } @@ -1266,7 +1266,7 @@ void CTriggerCounter :: Spawn( void ) if (m_cTriggersLeft == 0) m_cTriggersLeft = 2; - SetUse( &CounterUse ); + SetUse( &CBaseTrigger::CounterUse ); } // ====================== TRIGGER_CHANGELEVEL ================================ @@ -1411,11 +1411,11 @@ void CChangeLevel :: Spawn( void ) if (!FStringNull ( pev->targetname ) ) { - SetUse( &UseChangeLevel ); + SetUse( &CChangeLevel::UseChangeLevel ); } InitTrigger(); if ( !(pev->spawnflags & SF_CHANGELEVEL_USEONLY) ) - SetTouch( &TouchChangeLevel ); + SetTouch( &CChangeLevel::TouchChangeLevel ); // ALERT( at_console, "TRANSITION: %s (%s)\n", m_szMapName, m_szLandmarkName ); } @@ -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( &CBaseTrigger::ToggleUse ); UTIL_SetOrigin( pev, pev->origin ); // Link into the list } @@ -1938,7 +1938,7 @@ void CTriggerTeleport :: Spawn( void ) { InitTrigger(); - SetTouch( &TeleportTouch ); + SetTouch( &CBaseTrigger::TeleportTouch ); } @@ -1963,7 +1963,7 @@ void CTriggerSave::Spawn( void ) } InitTrigger(); - SetTouch( &SaveTouch ); + SetTouch( &CTriggerSave::SaveTouch ); } void CTriggerSave::SaveTouch( CBaseEntity *pOther ) @@ -2018,10 +2018,10 @@ void CTriggerEndSection::Spawn( void ) InitTrigger(); - SetUse( &EndSectionUse ); + SetUse( &CTriggerEndSection::EndSectionUse ); // If it is a "use only" trigger, then don't set the touch function. if ( ! (pev->spawnflags & SF_ENDSECTION_USEONLY) ) - SetTouch( &EndSectionTouch ); + SetTouch( &CTriggerEndSection::EndSectionTouch ); } void CTriggerEndSection::EndSectionTouch( CBaseEntity *pOther ) @@ -2064,7 +2064,7 @@ LINK_ENTITY_TO_CLASS( trigger_gravity, CTriggerGravity ); void CTriggerGravity::Spawn( void ) { InitTrigger(); - SetTouch( &GravityTouch ); + SetTouch( &CTriggerGravity::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( &CTriggerCamera::FollowTarget ); pev->nextthink = gpGlobals->time; m_moveDistance = 0; diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index ce140f6c..11a6d959 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( &CTripmineGrenade::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( &CTripmineGrenade::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( &CBaseEntity::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( &CBaseEntity::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( &CTripmineGrenade::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( &CBaseEntity::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( &CTripmineGrenade::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 cc28f0bb..2077e87d 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( &CBaseTurret::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( &CBaseTurret::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( &CBaseTurret::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( &CBaseTurret::AutoSearchThink); pev->nextthink = gpGlobals->time + .1; } else - SetThink( &SUB_DoNothing); + SetThink( &CBaseEntity::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( &CBaseTurret::Retire); } else { @@ -411,7 +411,7 @@ void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ m_iAutoStart = TRUE; } - SetThink( &Deploy); + SetThink( &CBaseTurret::Deploy); } } @@ -472,7 +472,7 @@ void CBaseTurret::ActiveThink(void) { m_hEnemy = NULL; m_flLastSight = gpGlobals->time + m_flMaxWait; - SetThink( &SearchThink); + SetThink( &CBaseTurret::SearchThink); return; } @@ -489,7 +489,7 @@ void CBaseTurret::ActiveThink(void) { m_hEnemy = NULL; m_flLastSight = gpGlobals->time + m_flMaxWait; - SetThink( &SearchThink); + SetThink( &CBaseTurret::SearchThink); return; } } @@ -518,7 +518,7 @@ void CBaseTurret::ActiveThink(void) { m_hEnemy = NULL; m_flLastSight = gpGlobals->time + m_flMaxWait; - SetThink( &SearchThink); + SetThink( &CBaseTurret::SearchThink); return; } } @@ -670,7 +670,7 @@ void CBaseTurret::Deploy(void) SetTurretAnim(TURRET_ANIM_SPIN); pev->framerate = 0; - SetThink( &SearchThink); + SetThink( &CBaseTurret::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( &CBaseTurret::AutoSearchThink); pev->nextthink = gpGlobals->time + .1; } else - SetThink( &SUB_DoNothing); + SetThink( &CBaseEntity::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( &CBaseTurret::ActiveThink); m_iStartSpin = 0; m_iSpin = 1; } @@ -758,7 +758,7 @@ void CTurret::SpinUpCall(void) if (m_iSpin) { - SetThink( &ActiveThink); + SetThink( &CBaseTurret::ActiveThink); } } @@ -856,7 +856,7 @@ void CBaseTurret::SearchThink(void) { m_flLastSight = 0; m_flSpinUpTime = 0; - SetThink( &ActiveThink); + SetThink( &CBaseTurret::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( &CBaseTurret::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( &CBaseTurret::Deploy); EMIT_SOUND(ENT(pev), CHAN_BODY, "turret/tu_alert.wav", TURRET_MACHINE_VOLUME, ATTN_NORM); } } @@ -1025,7 +1025,7 @@ int CBaseTurret::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, flo ClearBits (pev->flags, FL_MONSTER); // why are they set in the first place??? SetUse( NULL ); - SetThink( &TurretDeath); + SetThink( &CBaseTurret::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( &CBaseTurret::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( &CSentry::SentryTouch); + SetThink( &CBaseTurret::Initialize); pev->nextthink = gpGlobals->time + 0.3; } @@ -1204,7 +1204,7 @@ int CSentry::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float f if (!m_iOn) { - SetThink( &Deploy ); + SetThink( &CBaseTurret::Deploy ); SetUse( NULL ); pev->nextthink = gpGlobals->time + 0.1; } @@ -1219,7 +1219,7 @@ int CSentry::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float f ClearBits (pev->flags, FL_MONSTER); // why are they set in the first place??? SetUse( NULL ); - SetThink( &SentryDeath); + SetThink( &CSentry::SentryDeath); SUB_UseTargets( this, USE_ON, 0 ); // wake up others pev->nextthink = gpGlobals->time + 0.1; diff --git a/dlls/util.cpp b/dlls/util.cpp index 867bb3e1..3533a778 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -1973,7 +1973,7 @@ void CSave :: WritePositionVector( const char *pname, const float *value, int co } -void CSave :: WriteFunction( const char *pname, void **data, int count ) +void CSave :: WriteFunction( const char *pname, const int *data, int count ) { const char *functionName; @@ -2141,7 +2141,7 @@ int CSave :: WriteFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *p break; case FIELD_FUNCTION: - WriteFunction( pTest->fieldName, (void **)pOutputData, pTest->fieldSize ); + WriteFunction( pTest->fieldName, (int *)pOutputData, pTest->fieldSize ); break; default: ALERT( at_error, "Bad field type\n" ); diff --git a/dlls/util.h b/dlls/util.h index 1edc0411..cbf3a9ca 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -36,7 +36,7 @@ extern globalvars_t *gpGlobals; // Use this instead of ALLOC_STRING on constant strings #define STRING(offset) (const char *)(gpGlobals->pStringBase + (int)offset) -#define MAKE_STRING(str) ((int)str - (int)STRING(0)) +#define MAKE_STRING(str) ((int)(size_t)str - (int)(size_t)STRING(0)) inline edict_t *FIND_ENTITY_BY_CLASSNAME(edict_t *entStart, const char *pszName) { @@ -248,7 +248,7 @@ typedef enum { ignore_monsters=1, dont_ignore_monsters=0, missile=2 } IGNORE_MON typedef enum { ignore_glass=1, dont_ignore_glass=0 } IGNORE_GLASS; extern void UTIL_TraceLine (const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, edict_t *pentIgnore, TraceResult *ptr); extern void UTIL_TraceLine (const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, IGNORE_GLASS ignoreGlass, edict_t *pentIgnore, TraceResult *ptr); -typedef enum { point_hull=0, human_hull=1, large_hull=2, head_hull=3 }; +enum { point_hull=0, human_hull=1, large_hull=2, head_hull=3 }; extern void UTIL_TraceHull (const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, int hullNumber, edict_t *pentIgnore, TraceResult *ptr); extern TraceResult UTIL_GetGlobalTrace (void); extern void UTIL_TraceModel (const Vector &vecStart, const Vector &vecEnd, int hullNumber, edict_t *pentModel, TraceResult *ptr); diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 264edb88..6a65f298 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( &CBasePlayerItem::DefaultTouch ); + SetThink( &CBasePlayerItem::FallThink ); pev->nextthink = gpGlobals->time + 0.1; } @@ -528,7 +528,7 @@ void CBasePlayerItem::Materialize( void ) pev->solid = SOLID_TRIGGER; UTIL_SetOrigin( pev, pev->origin );// link into world. - SetTouch( &DefaultTouch); + SetTouch( &CBasePlayerItem::DefaultTouch); SetThink( NULL ); } @@ -581,7 +581,7 @@ CBaseEntity* CBasePlayerItem::Respawn( void ) { pNewWeapon->pev->effects |= EF_NODRAW;// invisible for now pNewWeapon->SetTouch( NULL );// no touch - pNewWeapon->SetThink( &AttemptToMaterialize ); + pNewWeapon->SetThink( &CBasePlayerItem::AttemptToMaterialize ); DROP_TO_FLOOR ( ENT(pev) ); @@ -739,14 +739,14 @@ int CBasePlayerItem::AddToPlayer( CBasePlayer *pPlayer ) void CBasePlayerItem::Drop( void ) { SetTouch( NULL ); - SetThink( &SUB_Remove); + SetThink( &CBaseEntity::SUB_Remove); pev->nextthink = gpGlobals->time + .1; } void CBasePlayerItem::Kill( void ) { SetTouch( NULL ); - SetThink( &SUB_Remove); + SetThink( &CBaseEntity::SUB_Remove); pev->nextthink = gpGlobals->time + .1; } @@ -1066,7 +1066,7 @@ void CBasePlayerAmmo::Spawn( void ) UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16)); UTIL_SetOrigin( pev, pev->origin ); - SetTouch( &DefaultTouch ); + SetTouch( &CBaseEntity::DefaultTouch ); } CBaseEntity* CBasePlayerAmmo::Respawn( void ) @@ -1076,7 +1076,7 @@ CBaseEntity* CBasePlayerAmmo::Respawn( void ) UTIL_SetOrigin( pev, g_pGameRules->VecAmmoRespawnSpot( this ) );// move to wherever I'm supposed to repawn. - SetThink( &Materialize ); + SetThink( &CBasePlayerAmmo::Materialize ); pev->nextthink = g_pGameRules->FlAmmoRespawnTime( this ); return this; @@ -1092,7 +1092,7 @@ void CBasePlayerAmmo::Materialize( void ) pev->effects |= EF_MUZZLEFLASH; } - SetTouch( &DefaultTouch ); + SetTouch( &CBasePlayerAmmo::DefaultTouch ); } void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther ) @@ -1111,7 +1111,7 @@ void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther ) else { SetTouch( NULL ); - SetThink( &SUB_Remove); + SetThink( &CBaseEntity::SUB_Remove); pev->nextthink = gpGlobals->time + .1; } } @@ -1119,7 +1119,7 @@ void CBasePlayerAmmo :: DefaultTouch( CBaseEntity *pOther ) { // evil impulse 101 hack, kill always SetTouch( NULL ); - SetThink( &SUB_Remove); + SetThink( &CBaseEntity::SUB_Remove); pev->nextthink = gpGlobals->time + .1; } } @@ -1256,7 +1256,7 @@ void CWeaponBox::Kill( void ) while ( pWeapon ) { - pWeapon->SetThink( &SUB_Remove); + pWeapon->SetThink( &CBaseEntity::SUB_Remove); pWeapon->pev->nextthink = gpGlobals->time + 0.1; pWeapon = pWeapon->m_pNext; } diff --git a/dlls/weapons.h b/dlls/weapons.h index aaa98247..38ba9794 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -445,7 +445,7 @@ public: int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; - HasWeapon( CBasePlayerItem *pCheckItem ); + BOOL HasWeapon( CBasePlayerItem *pCheckItem ); BOOL PackWeapon( CBasePlayerItem *pWeapon ); BOOL PackAmmo( int iszName, int iCount ); diff --git a/dlls/world.cpp b/dlls/world.cpp index cb20add3..1206824b 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -125,15 +125,15 @@ void CDecal :: Spawn( void ) if ( FStringNull ( pev->targetname ) ) { - SetThink( &StaticDecal ); + SetThink( &CDecal::StaticDecal ); // if there's no targetname, the decal will spray itself on as soon as the world is done spawning. 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( &CBaseEntity::SUB_DoNothing ); + SetUse( &CDecal::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( &CBaseEntity::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( &CBaseEntity::SUB_CallUseToggle ); pEntity->pev->message = pev->netname; pev->netname = 0; pEntity->pev->nextthink = gpGlobals->time + 0.3; @@ -857,4 +857,4 @@ int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEn memcpy( pFunctionTable, &gPhysicsInterface, sizeof( physics_interface_t ) ); return TRUE; -} \ No newline at end of file +} diff --git a/game_shared/bitvec.h b/game_shared/bitvec.h index 0271a117..58871a4a 100644 --- a/game_shared/bitvec.h +++ b/game_shared/bitvec.h @@ -13,7 +13,7 @@ #include - +#include class CBitVecAccessor { diff --git a/game_shared/voice_gamemgr.cpp b/game_shared/voice_gamemgr.cpp index 5ba2edfe..b3f16714 100644 --- a/game_shared/voice_gamemgr.cpp +++ b/game_shared/voice_gamemgr.cpp @@ -179,7 +179,7 @@ bool CVoiceGameMgr::ClientCommand(CBasePlayer *pPlayer, const char *cmd) for(int i=1; i < CMD_ARGC(); i++) { unsigned long mask = 0; - sscanf(CMD_ARGV(i), "%x", &mask); + sscanf(CMD_ARGV(i), "%lx", &mask); if(i <= VOICE_MAX_PLAYERS_DW) { @@ -238,7 +238,7 @@ void CVoiceGameMgr::UpdateMasks() // Build a mask of who they can hear based on the game rules. for(int iOtherClient=0; iOtherClient < m_nMaxPlayers; iOtherClient++) { - CBaseEntity *pEnt = UTIL_PlayerByIndex(iOtherClient+1); + pEnt = UTIL_PlayerByIndex(iOtherClient+1); if(pEnt && pEnt->IsPlayer() && (bAllTalk || m_pHelper->CanPlayerHearPlayer(pPlayer, (CBasePlayer*)pEnt)) ) { From bdc4e3f8d39f5d9e02a93b1d643d3ab738300c4a Mon Sep 17 00:00:00 2001 From: Night Owl Date: Mon, 18 Apr 2016 01:44:31 +0500 Subject: [PATCH 3/3] Fix build. --- dlls/weapons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 6a65f298..e82d1006 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -1066,7 +1066,7 @@ void CBasePlayerAmmo::Spawn( void ) UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16)); UTIL_SetOrigin( pev, pev->origin ); - SetTouch( &CBaseEntity::DefaultTouch ); + SetTouch( &CBasePlayerAmmo::DefaultTouch ); } CBaseEntity* CBasePlayerAmmo::Respawn( void )