Browse Source

Apply some @AlliedModders's patches.

halloween
Night Owl 8 years ago
parent
commit
2faa732aa1
  1. 4
      cl_dll/ammo.cpp
  2. 8
      cl_dll/com_weapons.cpp
  3. 8
      cl_dll/com_weapons.h
  4. 5
      cl_dll/death.cpp
  5. 12
      cl_dll/entity.cpp
  6. 28
      cl_dll/ev_hldm.cpp
  7. 54
      cl_dll/geiger.cpp
  8. 10
      cl_dll/hl/hl_baseentity.cpp
  9. 8
      cl_dll/hl/hl_weapons.cpp
  10. 12
      cl_dll/hud.h
  11. 10
      cl_dll/hud_redraw.cpp
  12. 6
      cl_dll/message.cpp
  13. 4
      cl_dll/status_icons.cpp
  14. 20
      cl_dll/text_message.cpp
  15. 6
      cl_dll/view.cpp
  16. 4
      common/cvardef.h
  17. 2
      dlls/activity.h
  18. 2
      dlls/activitymap.h
  19. 1
      dlls/aflock.cpp
  20. 6
      dlls/agrunt.cpp
  21. 6
      dlls/animation.cpp
  22. 5
      dlls/apache.cpp
  23. 6
      dlls/barnacle.cpp
  24. 16
      dlls/barney.cpp
  25. 4
      dlls/basemonster.h
  26. 7
      dlls/bigmomma.cpp
  27. 4
      dlls/bmodels.cpp
  28. 12
      dlls/bullsquid.cpp
  29. 20
      dlls/buttons.cpp
  30. 4
      dlls/cbase.cpp
  31. 7
      dlls/cbase.h
  32. 26
      dlls/client.cpp
  33. 19
      dlls/combat.cpp
  34. 9
      dlls/controller.cpp
  35. 3
      dlls/crossbow.cpp
  36. 4
      dlls/crowbar.cpp
  37. 2
      dlls/decals.h
  38. 24
      dlls/doors.cpp
  39. 18
      dlls/effects.cpp
  40. 8
      dlls/effects.h
  41. 10
      dlls/egon.cpp
  42. 8
      dlls/enginecallback.h
  43. 6
      dlls/extdll.h
  44. 13
      dlls/func_break.cpp
  45. 24
      dlls/func_tank.cpp
  46. 3
      dlls/gargantua.cpp
  47. 9
      dlls/gauss.cpp
  48. 2
      dlls/genericmonster.cpp
  49. 10
      dlls/ggrenade.cpp
  50. 8
      dlls/gman.cpp
  51. 6
      dlls/h_battery.cpp
  52. 4
      dlls/h_cine.cpp
  53. 6
      dlls/h_cycler.cpp
  54. 6
      dlls/hassassin.cpp
  55. 4
      dlls/headcrab.cpp
  56. 6
      dlls/healthkit.cpp
  57. 26
      dlls/hgrunt.cpp
  58. 6
      dlls/hornet.cpp
  59. 2
      dlls/houndeye.cpp
  60. 8
      dlls/ichthyosaur.cpp
  61. 20
      dlls/islave.cpp
  62. 2
      dlls/leech.cpp
  63. 17
      dlls/lights.cpp
  64. 6
      dlls/maprules.cpp
  65. 22
      dlls/monsters.cpp
  66. 6
      dlls/monsterstate.cpp
  67. 4
      dlls/mpstubb.cpp
  68. 16
      dlls/multiplay_gamerules.cpp
  69. 44
      dlls/nihilanth.cpp
  70. 19
      dlls/nodes.cpp
  71. 4
      dlls/nodes.h
  72. 18
      dlls/observer.cpp
  73. 8
      dlls/osprey.cpp
  74. 8
      dlls/plats.cpp
  75. 66
      dlls/player.cpp
  76. 4
      dlls/player.h
  77. 4
      dlls/satchel.cpp
  78. 11
      dlls/saverestore.h
  79. 22
      dlls/schedule.cpp
  80. 18
      dlls/scientist.cpp
  81. 4
      dlls/scripted.cpp
  82. 5
      dlls/skill.cpp
  83. 2
      dlls/skill.h
  84. 12
      dlls/sound.cpp
  85. 12
      dlls/squadmonster.cpp
  86. 2
      dlls/squadmonster.h
  87. 16
      dlls/squeakgrenade.cpp
  88. 32
      dlls/talkmonster.cpp
  89. 4
      dlls/talkmonster.h
  90. 10
      dlls/teamplay_gamerules.cpp
  91. 9
      dlls/tentacle.cpp
  92. 10
      dlls/triggers.cpp
  93. 8
      dlls/tripmine.cpp
  94. 18
      dlls/turret.cpp
  95. 20
      dlls/util.cpp
  96. 9
      dlls/util.h
  97. 14
      dlls/vector.h
  98. 4
      dlls/weapons.cpp
  99. 8
      dlls/weapons.h
  100. 4
      dlls/world.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

4
cl_dll/ammo.cpp

@ -877,11 +877,11 @@ int CHudAmmo::Draw( float flTime ) @@ -877,11 +877,11 @@ int CHudAmmo::Draw( float flTime )
x = ScreenWidth - ( 8 * AmmoWidth ) - iIconWidth;
x = gHUD.DrawHudNumber( x, y, iFlags | DHN_3DIGITS, pw->iClip, r, g, b );
wrect_t rc;
/*wrect_t rc;
rc.top = 0;
rc.left = 0;
rc.right = AmmoWidth;
rc.bottom = 100;
rc.bottom = 100;*/
int iBarWidth = AmmoWidth / 10;

8
cl_dll/com_weapons.cpp

@ -41,7 +41,7 @@ COM_Log @@ -41,7 +41,7 @@ COM_Log
Log debug messages to file ( appends )
====================
*/
void COM_Log( char *pszFile, char *fmt, ... )
void COM_Log( const char *pszFile, const char *fmt, ... )
{
va_list argptr;
char string[1024];
@ -111,7 +111,7 @@ HUD_PlaySound @@ -111,7 +111,7 @@ HUD_PlaySound
Play a sound, if we are seeing this command for the first time
=====================
*/
void HUD_PlaySound( char *sound, float volume )
void HUD_PlaySound( const char *sound, float volume )
{
if( !g_runfuncs || !g_finalstate )
return;
@ -268,12 +268,12 @@ stub functions for such things as precaching. So we don't have to modify weapon @@ -268,12 +268,12 @@ stub functions for such things as precaching. So we don't have to modify weapon
is compiled into both game and client .dlls.
======================
*/
int stub_PrecacheModel( char* s )
int stub_PrecacheModel( const char* s )
{
return 0;
}
int stub_PrecacheSound( char* s )
int stub_PrecacheSound( const char* s )
{
return 0;
}

8
cl_dll/com_weapons.h

@ -20,7 +20,7 @@ extern "C" @@ -20,7 +20,7 @@ extern "C"
void _DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed );
}
void COM_Log( char *pszFile, char *fmt, ... );
void COM_Log( const char *pszFile, const char *fmt, ... );
int CL_IsDead( void );
float UTIL_SharedRandomFloat( unsigned int seed, float low, float high );
@ -28,11 +28,11 @@ int UTIL_SharedRandomLong( unsigned int seed, int low, int high ); @@ -28,11 +28,11 @@ int UTIL_SharedRandomLong( unsigned int seed, int low, int high );
int HUD_GetWeaponAnim( void );
void HUD_SendWeaponAnim( int iAnim, int body, int force );
void HUD_PlaySound( char *sound, float volume );
void HUD_PlaySound( const char *sound, float volume );
void HUD_PlaybackEvent( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
void HUD_SetMaxSpeed( const struct edict_s *ed, float speed );
int stub_PrecacheModel( char* s );
int stub_PrecacheSound( char* s );
int stub_PrecacheModel( const char* s );
int stub_PrecacheSound( const char* s );
unsigned short stub_PrecacheEvent( int type, const char *s );
const char *stub_NameForFunction( unsigned int function );
void stub_SetModel( struct edict_s *e, const char *m );

5
cl_dll/death.cpp

@ -187,7 +187,8 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu @@ -187,7 +187,8 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu
gHUD.m_Scoreboard.GetAllPlayersInfo();
// Get the Killer's name
char *killer_name = g_PlayerInfoList[killer].name;
const char *killer_name = "";
killer_name = g_PlayerInfoList[killer].name;
if( !killer_name )
{
killer_name = "";
@ -201,7 +202,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu @@ -201,7 +202,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu
}
// Get the Victim's name
char *victim_name = NULL;
const char *victim_name = "";
// If victim is -1, the killer killed a specific, non-player object (like a sentrygun)
if( ( (char)victim ) != -1 )
victim_name = g_PlayerInfoList[victim].name;

12
cl_dll/entity.cpp

@ -585,7 +585,7 @@ void DLLEXPORT HUD_TempEntUpdate ( @@ -585,7 +585,7 @@ void DLLEXPORT HUD_TempEntUpdate (
static int gTempEntFrame = 0;
int i;
TEMPENTITY *pTemp, *pnext, *pprev;
float freq, gravity, gravitySlow, life, fastFreq;
float /*freq,*/ gravity, gravitySlow, life, fastFreq;
// Nothing to simulate
if( !*ppTempEntActive )
@ -623,7 +623,7 @@ void DLLEXPORT HUD_TempEntUpdate ( @@ -623,7 +623,7 @@ void DLLEXPORT HUD_TempEntUpdate (
}
pprev = NULL;
freq = client_time * 0.01;
//freq = client_time * 0.01;
fastFreq = client_time * 5.5;
gravity = -frametime * cl_gravity;
gravitySlow = gravity * 0.5;
@ -709,12 +709,12 @@ void DLLEXPORT HUD_TempEntUpdate ( @@ -709,12 +709,12 @@ void DLLEXPORT HUD_TempEntUpdate (
}
else if( pTemp->flags & FTENT_SPIRAL )
{
float s, c;
/*float s, c;
s = sin( pTemp->entity.baseline.origin[2] + fastFreq );
c = cos( 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)(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[0] += pTemp->entity.baseline.origin[0] * frametime + 8 * sin( client_time * 20 + (size_t)pTemp );
pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * frametime + 4 * sin( client_time * 30 + (size_t)pTemp );
pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime;
}
else

28
cl_dll/ev_hldm.cpp

@ -94,7 +94,7 @@ float EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *v @@ -94,7 +94,7 @@ float EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *v
char chTextureType = CHAR_TEX_CONCRETE;
float fvol;
float fvolbar;
char *rgsz[4];
const char *rgsz[4];
int cnt;
float fattn = ATTN_NORM;
int entity;
@ -568,7 +568,7 @@ void EV_FireShotGunDouble( event_args_t *args ) @@ -568,7 +568,7 @@ void EV_FireShotGunDouble( event_args_t *args )
vec3_t vecSrc, vecAiming;
vec3_t vecSpread;
vec3_t up, right, forward;
float flSpread = 0.01;
//float flSpread = 0.01;
idx = args->entindex;
VectorCopy( args->origin, origin );
@ -622,7 +622,7 @@ void EV_FireShotGunSingle( event_args_t *args ) @@ -622,7 +622,7 @@ void EV_FireShotGunSingle( event_args_t *args )
vec3_t vecSrc, vecAiming;
vec3_t vecSpread;
vec3_t up, right, forward;
float flSpread = 0.01;
//float flSpread = 0.01;
idx = args->entindex;
VectorCopy( args->origin, origin );
@ -679,7 +679,7 @@ void EV_FireMP5( event_args_t *args ) @@ -679,7 +679,7 @@ void EV_FireMP5( event_args_t *args )
int shell;
vec3_t vecSrc, vecAiming;
vec3_t up, right, forward;
float flSpread = 0.01;
//float flSpread = 0.01;
idx = args->entindex;
VectorCopy( args->origin, origin );
@ -769,7 +769,7 @@ void EV_FirePython( event_args_t *args ) @@ -769,7 +769,7 @@ void EV_FirePython( event_args_t *args )
vec3_t vecSrc, vecAiming;
vec3_t up, right, forward;
float flSpread = 0.01;
//float flSpread = 0.01;
idx = args->entindex;
VectorCopy( args->origin, origin );
@ -860,16 +860,16 @@ void EV_FireGauss( event_args_t *args ) @@ -860,16 +860,16 @@ void EV_FireGauss( event_args_t *args )
vec3_t angles;
vec3_t velocity;
float flDamage = args->fparam1;
int primaryfire = args->bparam1;
//int primaryfire = args->bparam1;
int m_fPrimaryFire = args->bparam1;
int m_iWeaponVolume = GAUSS_PRIMARY_FIRE_VOLUME;
//int m_iWeaponVolume = GAUSS_PRIMARY_FIRE_VOLUME;
vec3_t vecSrc;
vec3_t vecDest;
edict_t *pentIgnore;
//edict_t *pentIgnore;
pmtrace_t tr, beam_tr;
float flMaxFrac = 1.0;
int nTotal = 0;
//int nTotal = 0;
int fHasPunched = 0;
int fFirstBeam = 1;
int nMaxHits = 10;
@ -980,7 +980,7 @@ void EV_FireGauss( event_args_t *args ) @@ -980,7 +980,7 @@ void EV_FireGauss( event_args_t *args )
{
float n;
pentIgnore = NULL;
//pentIgnore = NULL;
n = -DotProduct( tr.plane.normal, forward );
@ -1412,12 +1412,12 @@ BEAM *pBeam2; @@ -1412,12 +1412,12 @@ BEAM *pBeam2;
void EV_EgonFire( event_args_t *args )
{
int idx, iFireState, iFireMode;
int idx, /*iFireState,*/ iFireMode;
vec3_t origin;
idx = args->entindex;
VectorCopy( args->origin, origin );
iFireState = args->iparam1;
//iFireState = args->iparam1;
iFireMode = args->iparam2;
int iStartup = args->bparam1;
@ -1539,13 +1539,13 @@ enum hgun_e @@ -1539,13 +1539,13 @@ enum hgun_e
void EV_HornetGunFire( event_args_t *args )
{
int idx, iFireMode;
int idx; //, iFireMode;
vec3_t origin, angles, vecSrc, forward, right, up;
idx = args->entindex;
VectorCopy( args->origin, origin );
VectorCopy( args->angles, angles );
iFireMode = args->iparam1;
//iFireMode = args->iparam1;
//Only play the weapon anims if I shot it.
if( EV_IsLocal( idx ) )

54
cl_dll/geiger.cpp

@ -65,7 +65,7 @@ int CHudGeiger::Draw( float flTime ) @@ -65,7 +65,7 @@ int CHudGeiger::Draw( float flTime )
{
int pct;
float flvol = 0.0f;
int rg[3];
//int rg[3];
int i;
if( m_iGeigerRange < 1000 && m_iGeigerRange > 0 )
@ -79,61 +79,61 @@ int CHudGeiger::Draw( float flTime ) @@ -79,61 +79,61 @@ int CHudGeiger::Draw( float flTime )
{
pct = 2;
flvol = 0.4; //Con_Printf( "range > 600\n" );
rg[0] = 1;
rg[1] = 1;
//rg[0] = 1;
//rg[1] = 1;
i = 2;
}
else if( m_iGeigerRange > 500 )
{
pct = 4;
flvol = 0.5; //Con_Printf( "range > 500\n" );
rg[0] = 1;
rg[1] = 2;
//rg[0] = 1;
//rg[1] = 2;
i = 2;
}
else if( m_iGeigerRange > 400 )
{
pct = 8;
flvol = 0.6; //Con_Printf( "range > 400\n" );
rg[0] = 1;
rg[1] = 2;
rg[2] = 3;
//rg[0] = 1;
//rg[1] = 2;
//rg[2] = 3;
i = 3;
}
else if( m_iGeigerRange > 300 )
{
pct = 8;
flvol = 0.7; //Con_Printf( "range > 300\n" );
rg[0] = 2;
rg[1] = 3;
rg[2] = 4;
//rg[0] = 2;
//rg[1] = 3;
//rg[2] = 4;
i = 3;
}
else if( m_iGeigerRange > 200 )
{
pct = 28;
flvol = 0.78; //Con_Printf( "range > 200\n" );
rg[0] = 2;
rg[1] = 3;
rg[2] = 4;
//rg[0] = 2;
//rg[1] = 3;
//rg[2] = 4;
i = 3;
}
else if( m_iGeigerRange > 150 )
{
pct = 40;
flvol = 0.80; //Con_Printf( "range > 150\n" );
rg[0] = 3;
rg[1] = 4;
rg[2] = 5;
//rg[0] = 3;
//rg[1] = 4;
//rg[2] = 5;
i = 3;
}
else if( m_iGeigerRange > 100 )
{
pct = 60;
flvol = 0.85; //Con_Printf( "range > 100\n" );
rg[0] = 3;
rg[1] = 4;
rg[2] = 5;
//rg[0] = 3;
//rg[1] = 4;
//rg[2] = 5;
i = 3;
}
else if( m_iGeigerRange > 75 )
@ -141,25 +141,25 @@ int CHudGeiger::Draw( float flTime ) @@ -141,25 +141,25 @@ int CHudGeiger::Draw( float flTime )
pct = 80;
flvol = 0.9; //Con_Printf( "range > 75\n" );
//gflGeigerDelay = cl.time + GEIGERDELAY * 0.75;
rg[0] = 4;
rg[1] = 5;
rg[2] = 6;
//rg[0] = 4;
//rg[1] = 5;
//rg[2] = 6;
i = 3;
}
else if( m_iGeigerRange > 50 )
{
pct = 90;
flvol = 0.95; //Con_Printf( "range > 50\n" );
rg[0] = 5;
rg[1] = 6;
//rg[0] = 5;
//rg[1] = 6;
i = 2;
}
else
{
pct = 95;
flvol = 1.0; //Con_Printf( "range < 50\n" );
rg[0] = 5;
rg[1] = 6;
//rg[0] = 5;
//rg[1] = 6;
i = 2;
}

10
cl_dll/hl/hl_baseentity.cpp

@ -54,7 +54,7 @@ int CBaseEntity::IsDormant( void ) { return 0; } @@ -54,7 +54,7 @@ int CBaseEntity::IsDormant( void ) { return 0; }
BOOL CBaseEntity::IsInWorld( void ) { return TRUE; }
int CBaseEntity::ShouldToggle( USE_TYPE useType, BOOL currentState ) { return 0; }
int CBaseEntity::DamageDecal( int bitsDamageType ) { return -1; }
CBaseEntity *CBaseEntity::Create( char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner ) { return NULL; }
CBaseEntity *CBaseEntity::Create( const char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner ) { return NULL; }
void CBaseEntity::SUB_Remove( void ) { }
// CBaseDelay Stubs
@ -146,7 +146,7 @@ int CBaseMonster::CheckEnemy( CBaseEntity *pEnemy ) { return 0; } @@ -146,7 +146,7 @@ int CBaseMonster::CheckEnemy( CBaseEntity *pEnemy ) { return 0; }
void CBaseMonster::PushEnemy( CBaseEntity *pEnemy, Vector &vecLastKnownPos ) { }
BOOL CBaseMonster::PopEnemy() { return FALSE; }
void CBaseMonster::SetActivity( Activity NewActivity ) { }
void CBaseMonster::SetSequenceByName( char *szSequence ) { }
void CBaseMonster::SetSequenceByName( const char *szSequence ) { }
int CBaseMonster::CheckLocalMove( const Vector &vecStart, const Vector &vecEnd, CBaseEntity *pTarget, float *pflDist ) { return 0; }
float CBaseMonster::OpenDoorAndWait( entvars_t *pevDoor ) { return 0.0; }
void CBaseMonster::AdvanceRoute( float distance ) { }
@ -214,7 +214,7 @@ void CBaseMonster::MonsterInitDead( void ) { } @@ -214,7 +214,7 @@ void CBaseMonster::MonsterInitDead( void ) { }
BOOL CBaseMonster::BBoxFlat( void ) { return TRUE; }
BOOL CBaseMonster::GetEnemy( void ) { return FALSE; }
void CBaseMonster::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { }
CBaseEntity* CBaseMonster::DropItem( char *pszItemName, const Vector &vecPos, const Vector &vecAng ) { return NULL; }
CBaseEntity* CBaseMonster::DropItem( const char *pszItemName, const Vector &vecPos, const Vector &vecAng ) { return NULL; }
BOOL CBaseMonster::ShouldFadeOnDeath( void ) { return FALSE; }
void CBaseMonster::RadiusDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { }
void CBaseMonster::RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { }
@ -258,7 +258,7 @@ void CBasePlayer::PreThink(void) { } @@ -258,7 +258,7 @@ void CBasePlayer::PreThink(void) { }
void CBasePlayer::CheckTimeBasedDamage() { }
void CBasePlayer::UpdateGeigerCounter( void ) { }
void CBasePlayer::CheckSuitUpdate() { }
void CBasePlayer::SetSuitUpdate(char *name, int fgroup, int iNoRepeatTime) { }
void CBasePlayer::SetSuitUpdate( const char *name, int fgroup, int iNoRepeatTime ) { }
void CBasePlayer::UpdatePlayerSound( void ) { }
void CBasePlayer::PostThink() { }
void CBasePlayer::Precache( void ) { }
@ -298,7 +298,7 @@ BOOL CBasePlayer::HasPlayerItem( CBasePlayerItem *pCheckItem ) { return FALSE; } @@ -298,7 +298,7 @@ BOOL CBasePlayer::HasPlayerItem( CBasePlayerItem *pCheckItem ) { return FALSE; }
BOOL CBasePlayer::SwitchWeapon( CBasePlayerItem *pWeapon ) { return FALSE; }
Vector CBasePlayer::GetGunPosition( void ) { return g_vecZero; }
const char *CBasePlayer::TeamID( void ) { return ""; }
int CBasePlayer::GiveAmmo( int iCount, char *szName, int iMax ) { return 0; }
int CBasePlayer::GiveAmmo( int iCount, const char *szName, int iMax ) { return 0; }
void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore ) { }
void CBasePlayer::AddPointsToTeam( int score, BOOL bAllowNegativeScore ) { }

8
cl_dll/hl/hl_weapons.cpp

@ -75,7 +75,7 @@ AlertMessage @@ -75,7 +75,7 @@ AlertMessage
Print debug messages to console
======================
*/
void AlertMessage( ALERT_TYPE atype, char *szFmt, ... )
void AlertMessage( ALERT_TYPE atype, const char *szFmt, ... )
{
va_list argptr;
static char string[1024];
@ -96,7 +96,7 @@ bool bIsMultiplayer( void ) @@ -96,7 +96,7 @@ bool bIsMultiplayer( void )
}
//Just loads a v_ model.
void LoadVModel( char *szViewModel, CBasePlayer *m_pPlayer )
void LoadVModel( const char *szViewModel, CBasePlayer *m_pPlayer )
{
gEngfuncs.CL_LoadModel( szViewModel, &m_pPlayer->pev->viewmodel );
}
@ -208,7 +208,7 @@ CBasePlayerWeapon::DefaultDeploy @@ -208,7 +208,7 @@ CBasePlayerWeapon::DefaultDeploy
=====================
*/
BOOL CBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal, int body )
BOOL CBasePlayerWeapon::DefaultDeploy( const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal, int body )
{
if( !CanDeploy() )
return FALSE;
@ -288,7 +288,7 @@ Only produces random numbers to match the server ones. @@ -288,7 +288,7 @@ Only produces random numbers to match the server ones.
*/
Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker, int shared_rand )
{
float x = 0, y = 0, z;
float x = 0.0f, y = 0.0f, z;
for( ULONG iShot = 1; iShot <= cShots; iShot++ )
{

12
cl_dll/hud.h

@ -480,7 +480,7 @@ public: @@ -480,7 +480,7 @@ public:
int Init( void );
static char *LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size );
static char *BufferedLocaliseTextString( const char *msg );
char *LookupString( const char *msg_name, int *msg_dest = NULL );
const char *LookupString( const char *msg_name, int *msg_dest = NULL );
int MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf );
};
@ -541,8 +541,8 @@ public: @@ -541,8 +541,8 @@ public:
//had to make these public so CHud could access them (to enable concussion icon)
//could use a friend declaration instead...
void EnableIcon( char *pszIconName, unsigned char red, unsigned char green, unsigned char blue );
void DisableIcon( char *pszIconName );
void EnableIcon( const char *pszIconName, unsigned char red, unsigned char green, unsigned char blue );
void DisableIcon( const char *pszIconName );
private:
typedef struct
@ -588,11 +588,11 @@ public: @@ -588,11 +588,11 @@ public:
int m_iFontHeight;
int DrawHudNumber( int x, int y, int iFlags, int iNumber, int r, int g, int b );
int DrawHudString( int x, int y, int iMaxX, char *szString, int r, int g, int b );
int DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b );
int DrawHudString( int x, int y, int iMaxX, const char *szString, int r, int g, int b );
int DrawHudStringReverse( int xpos, int ypos, int iMinX, const char *szString, int r, int g, int b );
int DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int r, int g, int b );
int GetNumWidth( int iNumber, int iFlags );
int DrawHudStringLen( char *szIt );
int DrawHudStringLen( const char *szIt );
void DrawDarkRectangle( int x, int y, int wide, int tall );
private:

10
cl_dll/hud_redraw.cpp

@ -199,7 +199,7 @@ const unsigned char colors[8][3] = @@ -199,7 +199,7 @@ const unsigned char colors[8][3] =
{240, 180, 24}
};
int CHud::DrawHudString( int xpos, int ypos, int iMaxX, char *szIt, int r, int g, int b )
int CHud::DrawHudString( int xpos, int ypos, int iMaxX, const char *szIt, int r, int g, int b )
{
if( hud_textmode->value == 2 )
{
@ -233,9 +233,7 @@ int CHud::DrawHudString( int xpos, int ypos, int iMaxX, char *szIt, int r, int g @@ -233,9 +233,7 @@ int CHud::DrawHudString( int xpos, int ypos, int iMaxX, char *szIt, int r, int g
return xpos;
}
int DrawUtfString( int xpos, int ypos, int iMaxX, char *szIt, int r, int g, int b )
int DrawUtfString( int xpos, int ypos, int iMaxX, const char *szIt, int r, int g, int b )
{
// xash3d: reset unicode state
gEngfuncs.pfnVGUI2DrawCharacterAdditive( 0, 0, 0, 0, 0, 0, 0 );
@ -262,7 +260,7 @@ int DrawUtfString( int xpos, int ypos, int iMaxX, char *szIt, int r, int g, int @@ -262,7 +260,7 @@ int DrawUtfString( int xpos, int ypos, int iMaxX, char *szIt, int r, int g, int
return xpos;
}
int CHud::DrawHudStringLen( char *szIt )
int CHud::DrawHudStringLen( const char *szIt )
{
int l = 0;
for( ; *szIt != 0 && *szIt != '\n'; szIt++ )
@ -280,7 +278,7 @@ int CHud::DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int r @@ -280,7 +278,7 @@ int CHud::DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int r
}
// draws a string from right to left (right-aligned)
int CHud::DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b )
int CHud::DrawHudStringReverse( int xpos, int ypos, int iMinX, const char *szString, int r, int g, int b )
{
// find the end of the string
for( char *szIt = szString; *szIt != 0; szIt++ )

6
cl_dll/message.cpp

@ -29,7 +29,7 @@ DECLARE_MESSAGE( m_Message, GameTitle ) @@ -29,7 +29,7 @@ DECLARE_MESSAGE( m_Message, GameTitle )
// 1 Global client_textmessage_t for custom messages that aren't in the titles.txt
client_textmessage_t g_pCustomMessage;
char *g_pCustomName = "Custom";
const char *g_pCustomName = "Custom";
char g_pCustomText[1024];
int CHudMessage::Init( void )
@ -260,7 +260,7 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time ) @@ -260,7 +260,7 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time )
width = 0;
}
else
width += gHUD.m_scrinfo.charWidths[*pText];
width += gHUD.m_scrinfo.charWidths[(unsigned char)*pText];
pText++;
length++;
}
@ -310,7 +310,7 @@ int CHudMessage::Draw( float fTime ) @@ -310,7 +310,7 @@ int CHudMessage::Draw( float fTime )
{
int i, drawn;
client_textmessage_t *pMessage;
float endTime = 0;
float endTime = 0.0f;
drawn = 0;

4
cl_dll/status_icons.cpp

@ -104,7 +104,7 @@ int CHudStatusIcons::MsgFunc_StatusIcon( const char *pszName, int iSize, void *p @@ -104,7 +104,7 @@ 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 )
void CHudStatusIcons::EnableIcon( const char *pszIconName, unsigned char red, unsigned char green, unsigned char blue )
{
int i;
@ -149,7 +149,7 @@ void CHudStatusIcons::EnableIcon( char *pszIconName, unsigned char red, unsigned @@ -149,7 +149,7 @@ void CHudStatusIcons::EnableIcon( char *pszIconName, unsigned char red, unsigned
}
}
void CHudStatusIcons::DisableIcon( char *pszIconName )
void CHudStatusIcons::DisableIcon( const char *pszIconName )
{
// find the sprite is in the current list
for( int i = 0; i < MAX_ICONSPRITES; i++ )

20
cl_dll/text_message.cpp

@ -45,7 +45,7 @@ int CHudTextMessage::Init( void ) @@ -45,7 +45,7 @@ int CHudTextMessage::Init( void )
char *CHudTextMessage::LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size )
{
char *dst = dst_buffer;
for( char *src = (char*)msg; *src != 0 && buffer_size > 0; buffer_size-- )
for( char *src = msg; *src != 0 && buffer_size > 0; buffer_size-- )
{
if( *src == '#' )
{
@ -91,12 +91,12 @@ char *CHudTextMessage::LocaliseTextString( const char *msg, char *dst_buffer, in @@ -91,12 +91,12 @@ char *CHudTextMessage::LocaliseTextString( const char *msg, char *dst_buffer, in
char *CHudTextMessage::BufferedLocaliseTextString( const char *msg )
{
static char dst_buffer[1024];
LocaliseTextString( msg, dst_buffer, 1024 );
LocaliseTextString( msg, dst_buffer, sizeof(dst_buffer) );
return dst_buffer;
}
// Simplified version of LocaliseTextString; assumes string is only one word
char *CHudTextMessage::LookupString( const char *msg, int *msg_dest )
const char *CHudTextMessage::LookupString( const char *msg, int *msg_dest )
{
if( !msg )
return "";
@ -108,7 +108,7 @@ char *CHudTextMessage::LookupString( const char *msg, int *msg_dest ) @@ -108,7 +108,7 @@ char *CHudTextMessage::LookupString( const char *msg, int *msg_dest )
client_textmessage_t *clmsg = TextMessageGet( msg + 1 );
if( !clmsg || !(clmsg->pMessage) )
return (char*)msg; // lookup failed, so return the original string
return msg; // lookup failed, so return the original string
if( msg_dest )
{
@ -118,12 +118,12 @@ char *CHudTextMessage::LookupString( const char *msg, int *msg_dest ) @@ -118,12 +118,12 @@ char *CHudTextMessage::LookupString( const char *msg, int *msg_dest )
*msg_dest = -clmsg->effect;
}
return (char*)clmsg->pMessage;
return clmsg->pMessage;
}
else
{
// nothing special about this message, so just return the same string
return (char*)msg;
return msg;
}
}
@ -167,16 +167,16 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf @@ -167,16 +167,16 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf
msg_text = strcpy( szBuf[0], msg_text );
// keep reading strings and using C format strings for subsituting the strings into the localised text string
char *sstr1 = LookupString( READ_STRING() );
const char *sstr1 = LookupString( READ_STRING() );
sstr1 = strcpy( szBuf[1], sstr1 );
StripEndNewlineFromString( sstr1 ); // these strings are meant for subsitution into the main strings, so cull the automatic end newlines
char *sstr2 = LookupString( READ_STRING() );
const char *sstr2 = LookupString( READ_STRING() );
sstr2 = strcpy( szBuf[2], sstr2 );
StripEndNewlineFromString( sstr2 );
char *sstr3 = LookupString( READ_STRING() );
const char *sstr3 = LookupString( READ_STRING() );
sstr3 = strcpy( szBuf[3], sstr3 );
StripEndNewlineFromString( sstr3 );
char *sstr4 = LookupString( READ_STRING() );
const char *sstr4 = LookupString( READ_STRING() );
sstr4 = strcpy( szBuf[4], sstr4 );
StripEndNewlineFromString( sstr4 );
char *psz = szBuf[5];

6
cl_dll/view.cpp

@ -351,11 +351,11 @@ V_CalcIntermissionRefdef @@ -351,11 +351,11 @@ V_CalcIntermissionRefdef
*/
void V_CalcIntermissionRefdef( struct ref_params_s *pparams )
{
cl_entity_t *ent, *view;
cl_entity_t /**ent,*/ *view;
float old;
// ent is the player model ( visible when out of body )
ent = gEngfuncs.GetLocalPlayer();
//ent = gEngfuncs.GetLocalPlayer();
// view is the weapon model (only visible from inside body )
view = gEngfuncs.GetViewModel();
@ -1307,7 +1307,7 @@ void V_GetMapChasePosition( int target, float *cl_angles, float *origin, float * @@ -1307,7 +1307,7 @@ void V_GetMapChasePosition( int target, float *cl_angles, float *origin, float *
int V_FindViewModelByWeaponModel( int weaponindex )
{
static char *modelmap[][2] =
static const char *modelmap[][2] =
{
{ "models/p_crossbow.mdl", "models/v_crossbow.mdl" },
{ "models/p_crowbar.mdl", "models/v_crowbar.mdl" },

4
common/cvardef.h

@ -28,8 +28,8 @@ @@ -28,8 +28,8 @@
typedef struct cvar_s
{
char *name;
char *string;
const char *name;
const char *string;
int flags;
float value;
struct cvar_s *next;

2
dlls/activity.h

@ -99,7 +99,7 @@ typedef enum { @@ -99,7 +99,7 @@ typedef enum {
typedef struct
{
int type;
char *name;
const char *name;
} activity_map_t;
extern activity_map_t activity_map[];

2
dlls/activitymap.h

@ -93,5 +93,5 @@ _A( ACT_FLINCH_LEFTARM ), @@ -93,5 +93,5 @@ _A( ACT_FLINCH_LEFTARM ),
_A( ACT_FLINCH_RIGHTARM ),
_A( ACT_FLINCH_LEFTLEG ),
_A( ACT_FLINCH_RIGHTLEG ),
0, NULL
{ 0, NULL }
};

1
dlls/aflock.cpp

@ -567,7 +567,6 @@ void CFlockingFlyer::FlockLeaderThink( void ) @@ -567,7 +567,6 @@ void CFlockingFlyer::FlockLeaderThink( void )
TraceResult tr;
Vector vecDist;// used for general measurements
Vector vecDir;// used for general measurements
int cProcessed = 0;// keep track of how many other boids we've processed
float flLeftSide;
float flRightSide;

6
dlls/agrunt.cpp

@ -608,7 +608,7 @@ void CAGrunt::Spawn() @@ -608,7 +608,7 @@ void CAGrunt::Spawn()
//=========================================================
void CAGrunt::Precache()
{
int i;
size_t i;
PRECACHE_MODEL( "models/agrunt.mdl" );
@ -909,7 +909,7 @@ BOOL CAGrunt::FCanCheckAttacks( void ) @@ -909,7 +909,7 @@ BOOL CAGrunt::FCanCheckAttacks( void )
//=========================================================
BOOL CAGrunt::CheckMeleeAttack1( float flDot, float flDist )
{
if( HasConditions( bits_COND_SEE_ENEMY ) && flDist <= AGRUNT_MELEE_DIST && flDot >= 0.6 && m_hEnemy != NULL )
if( HasConditions( bits_COND_SEE_ENEMY ) && flDist <= AGRUNT_MELEE_DIST && flDot >= 0.6 && m_hEnemy != 0 )
{
return TRUE;
}
@ -1160,7 +1160,7 @@ Schedule_t *CAGrunt::GetScheduleOfType( int Type ) @@ -1160,7 +1160,7 @@ Schedule_t *CAGrunt::GetScheduleOfType( int Type )
case SCHED_FAIL:
// no fail schedule specified, so pick a good generic one.
{
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
// I have an enemy
// !!!LATER - what if this enemy is really far away and i'm chasing him?

6
dlls/animation.cpp

@ -268,8 +268,6 @@ int GetAnimationEvent( void *pmodel, entvars_t *pev, MonsterEvent_t *pMonsterEve @@ -268,8 +268,6 @@ int GetAnimationEvent( void *pmodel, entvars_t *pev, MonsterEvent_t *pMonsterEve
if( !pstudiohdr || pev->sequence >= pstudiohdr->numseq || !pMonsterEvent )
return 0;
int events = 0;
mstudioseqdesc_t *pseqdesc;
mstudioevent_t *pevent;
@ -351,7 +349,7 @@ float SetController( void *pmodel, entvars_t *pev, int iController, float flValu @@ -351,7 +349,7 @@ float SetController( void *pmodel, entvars_t *pev, int iController, float flValu
}
}
int setting = 255 * ( flValue - pbonecontroller->start ) / ( pbonecontroller->end - pbonecontroller->start );
int setting = (int)( 255 * ( flValue - pbonecontroller->start ) / ( pbonecontroller->end - pbonecontroller->start ) );
if( setting < 0 )
setting = 0;
@ -393,7 +391,7 @@ float SetBlending( void *pmodel, entvars_t *pev, int iBlender, float flValue ) @@ -393,7 +391,7 @@ float SetBlending( void *pmodel, entvars_t *pev, int iBlender, float flValue )
}
}
int setting = 255 * ( flValue - pseqdesc->blendstart[iBlender] ) / ( pseqdesc->blendend[iBlender] - pseqdesc->blendstart[iBlender] );
int setting = (int)( 255 * ( flValue - pseqdesc->blendstart[iBlender] ) / ( pseqdesc->blendend[iBlender] - pseqdesc->blendstart[iBlender] ) );
if( setting < 0 )
setting = 0;

5
dlls/apache.cpp

@ -458,7 +458,7 @@ void CApache::HuntThink( void ) @@ -458,7 +458,7 @@ void CApache::HuntThink( void )
if( m_flGoalSpeed < 800 )
m_flGoalSpeed += 5;
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
// ALERT( at_console, "%s\n", STRING( m_hEnemy->pev->classname ) );
if( FVisible( m_hEnemy ) )
@ -552,7 +552,7 @@ void CApache::HuntThink( void ) @@ -552,7 +552,7 @@ void CApache::HuntThink( void )
{
if( m_flLastSeen + 60 > gpGlobals->time )
{
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
// make sure it's a good shot
if( DotProduct( m_vecTarget, vecEst ) > .965 )
@ -732,7 +732,6 @@ void CApache::Flight( void ) @@ -732,7 +732,6 @@ void CApache::Flight( void )
void CApache::FireRocket( void )
{
static float side = 1.0;
static int count;
if( m_iRockets <= 0 )
return;

6
dlls/barnacle.cpp

@ -170,7 +170,7 @@ void CBarnacle::BarnacleThink( void ) @@ -170,7 +170,7 @@ void CBarnacle::BarnacleThink( void )
#endif
pev->nextthink = gpGlobals->time + 0.1;
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
// barnacle has prey.
if( !m_hEnemy->IsAlive() )
@ -183,7 +183,7 @@ void CBarnacle::BarnacleThink( void ) @@ -183,7 +183,7 @@ void CBarnacle::BarnacleThink( void )
if( m_fLiftingPrey )
{
if( m_hEnemy != NULL && m_hEnemy->pev->deadflag != DEAD_NO )
if( m_hEnemy != 0 && m_hEnemy->pev->deadflag != DEAD_NO )
{
// crap, someone killed the prey on the way up.
m_hEnemy = NULL;
@ -352,7 +352,7 @@ void CBarnacle::Killed( entvars_t *pevAttacker, int iGib ) @@ -352,7 +352,7 @@ void CBarnacle::Killed( entvars_t *pevAttacker, int iGib )
pev->solid = SOLID_NOT;
pev->takedamage = DAMAGE_NO;
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
pVictim = m_hEnemy->MyMonsterPointer();

16
dlls/barney.cpp

@ -221,7 +221,7 @@ void CBarney::RunTask( Task_t *pTask ) @@ -221,7 +221,7 @@ void CBarney::RunTask( Task_t *pTask )
switch( pTask->iTask )
{
case TASK_RANGE_ATTACK1:
if( m_hEnemy != NULL && ( m_hEnemy->IsPlayer() ) )
if( m_hEnemy != 0 && ( m_hEnemy->IsPlayer() ) )
{
pev->framerate = 1.5;
}
@ -262,7 +262,7 @@ int CBarney::Classify( void ) @@ -262,7 +262,7 @@ int CBarney::Classify( void )
//=========================================================
void CBarney::AlertSound( void )
{
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
if( FOkToSpeak() )
{
@ -504,7 +504,7 @@ int CBarney::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float @@ -504,7 +504,7 @@ int CBarney::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float
// This is a heurstic to determine if the player intended to harm me
// If I have an enemy, we can't establish intent (may just be crossfire)
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
// If the player was facing directly at me, or I'm already suspicious, get mad
if( ( m_afMemory & bits_MEMORY_SUSPICIOUS ) || IsFacing( pevAttacker, pev->origin ) )
@ -616,7 +616,7 @@ void CBarney::Killed( entvars_t *pevAttacker, int iGib ) @@ -616,7 +616,7 @@ void CBarney::Killed( entvars_t *pevAttacker, int iGib )
GetAttachment( 0, vecGunPos, vecGunAngles );
CBaseEntity *pGun = DropItem( "weapon_9mmhandgun", vecGunPos, vecGunAngles );
DropItem( "weapon_9mmhandgun", vecGunPos, vecGunAngles );
}
SetUse( NULL );
@ -633,7 +633,7 @@ Schedule_t *CBarney::GetScheduleOfType( int Type ) @@ -633,7 +633,7 @@ Schedule_t *CBarney::GetScheduleOfType( int Type )
switch( Type )
{
case SCHED_ARM_WEAPON:
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
// face enemy, then draw.
return slBarneyEnemyDraw;
@ -721,7 +721,7 @@ Schedule_t *CBarney::GetSchedule( void ) @@ -721,7 +721,7 @@ Schedule_t *CBarney::GetSchedule( void )
return GetScheduleOfType( SCHED_SMALL_FLINCH );
}
if( m_hEnemy == NULL && IsFollowing() )
if( m_hEnemy == 0 && IsFollowing() )
{
if( !m_hTargetEnt->IsAlive() )
{
@ -783,10 +783,10 @@ public: @@ -783,10 +783,10 @@ public:
void KeyValue( KeyValueData *pkvd );
int m_iPose;// which sequence to display -- temporary, don't need to save
static char *m_szPoses[3];
static const char *m_szPoses[3];
};
char *CDeadBarney::m_szPoses[] = { "lying_on_back", "lying_on_side", "lying_on_stomach" };
const char *CDeadBarney::m_szPoses[] = { "lying_on_back", "lying_on_side", "lying_on_stomach" };
void CDeadBarney::KeyValue( KeyValueData *pkvd )
{

4
dlls/basemonster.h

@ -195,7 +195,7 @@ public: @@ -195,7 +195,7 @@ public:
Task_t *GetTask( void );
virtual MONSTERSTATE GetIdealState( void );
virtual void SetActivity( Activity NewActivity );
void SetSequenceByName( char *szSequence );
void SetSequenceByName( const char *szSequence );
void SetState( MONSTERSTATE State );
virtual void ReportAIState( void );
@ -327,6 +327,6 @@ public: @@ -327,6 +327,6 @@ public:
BOOL ExitScriptedSequence();
BOOL CineCleanup();
CBaseEntity* DropItem ( char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item.
CBaseEntity* DropItem( const char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item.
};
#endif // BASEMONSTER_H

7
dlls/bigmomma.cpp

@ -677,7 +677,7 @@ void CBigMomma::Precache() @@ -677,7 +677,7 @@ void CBigMomma::Precache()
void CBigMomma::Activate( void )
{
if( m_hTargetEnt == NULL )
if( m_hTargetEnt == 0 )
Remember( bits_MEMORY_ADVANCE_NODE ); // Start 'er up
}
@ -985,7 +985,7 @@ void CBigMomma::RunTask( Task_t *pTask ) @@ -985,7 +985,7 @@ void CBigMomma::RunTask( Task_t *pTask )
{
float distance;
if( m_hTargetEnt == NULL )
if( m_hTargetEnt == 0 )
TaskFail();
else
{
@ -1002,7 +1002,7 @@ void CBigMomma::RunTask( Task_t *pTask ) @@ -1002,7 +1002,7 @@ void CBigMomma::RunTask( Task_t *pTask )
}
break;
case TASK_WAIT_NODE:
if( m_hTargetEnt != NULL && ( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT ) )
if( m_hTargetEnt != 0 && ( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT ) )
return;
if( gpGlobals->time > m_flWaitFinished )
@ -1056,7 +1056,6 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot @@ -1056,7 +1056,6 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot
float time = speed / flGravity;
vecGrenadeVel = vecSpot2 - vecSpot1;
vecGrenadeVel.z = 0;
float distance = vecGrenadeVel.Length();
// Travel half the distance to the target in that time (apex is at the midpoint)
vecGrenadeVel = vecGrenadeVel * ( 0.5 / time );

4
dlls/bmodels.cpp

@ -210,7 +210,7 @@ void CFuncIllusionary::KeyValue( KeyValueData *pkvd ) @@ -210,7 +210,7 @@ void CFuncIllusionary::KeyValue( KeyValueData *pkvd )
{
if( FStrEq( pkvd->szKeyName, "skin" ) )//skin is used for content type
{
pev->skin = atof( pkvd->szValue );
pev->skin = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else
@ -614,7 +614,7 @@ void CFuncRotating::SpinDown( void ) @@ -614,7 +614,7 @@ void CFuncRotating::SpinDown( void )
// stop sound, we're done
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, (char *)STRING( pev->noiseRunning /* Stop */ ),
0, 0, SND_STOP, m_pitch );
0, 0, SND_STOP, (int)m_pitch );
SetThink( &CFuncRotating::Rotate );
Rotate();

12
dlls/bullsquid.cpp

@ -248,7 +248,7 @@ int CBullsquid::IgnoreConditions( void ) @@ -248,7 +248,7 @@ int CBullsquid::IgnoreConditions( void )
iIgnore = bits_COND_SMELL | bits_COND_SMELL_FOOD;
}
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
if( FClassnameIs( m_hEnemy->pev, "monster_headcrab" ) )
{
@ -287,7 +287,7 @@ int CBullsquid::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo @@ -287,7 +287,7 @@ int CBullsquid::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo
// if the squid is running, has an enemy, was hurt by the enemy, hasn't been hurt in the last 3 seconds, and isn't too close to the enemy,
// it will swerve. (whew).
if( m_hEnemy != NULL && IsMoving() && pevAttacker == m_hEnemy->pev && gpGlobals->time - m_flLastHurtTime > 3 )
if( m_hEnemy != 0 && IsMoving() && pevAttacker == m_hEnemy->pev && gpGlobals->time - m_flLastHurtTime > 3 )
{
flDist = ( pev->origin - m_hEnemy->pev->origin ).Length2D();
@ -324,7 +324,7 @@ BOOL CBullsquid::CheckRangeAttack1( float flDot, float flDist ) @@ -324,7 +324,7 @@ BOOL CBullsquid::CheckRangeAttack1( float flDot, float flDist )
if( flDist > 64 && flDist <= 784 && flDot >= 0.5 && gpGlobals->time >= m_flNextSpitTime )
{
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
if( fabs( pev->origin.z - m_hEnemy->pev->origin.z ) > 256 )
{
@ -383,7 +383,7 @@ BOOL CBullsquid::CheckMeleeAttack2( float flDot, float flDist ) @@ -383,7 +383,7 @@ BOOL CBullsquid::CheckMeleeAttack2( float flDot, float flDist )
//=========================================================
BOOL CBullsquid::FValidateHintType( short sHint )
{
int i;
size_t i;
static short sSquidHints[] =
{
@ -784,7 +784,7 @@ void CBullsquid::RunAI( void ) @@ -784,7 +784,7 @@ void CBullsquid::RunAI( void )
pev->skin = 1;
}
if( m_hEnemy != NULL && m_Activity == ACT_RUN )
if( m_hEnemy != 0 && m_Activity == ACT_RUN )
{
// chasing enemy. Sprint for last bit
if( ( pev->origin - m_hEnemy->pev->origin).Length2D() < SQUID_SPRINT_DIST )
@ -1247,7 +1247,7 @@ MONSTERSTATE CBullsquid::GetIdealState( void ) @@ -1247,7 +1247,7 @@ MONSTERSTATE CBullsquid::GetIdealState( void )
COMBAT goes to ALERT upon death of enemy
*/
{
if( m_hEnemy != NULL && ( iConditions & bits_COND_LIGHT_DAMAGE || iConditions & bits_COND_HEAVY_DAMAGE ) && FClassnameIs( m_hEnemy->pev, "monster_headcrab" ) )
if( m_hEnemy != 0 && ( iConditions & bits_COND_LIGHT_DAMAGE || iConditions & bits_COND_HEAVY_DAMAGE ) && FClassnameIs( m_hEnemy->pev, "monster_headcrab" ) )
{
// if the squid has a headcrab enemy and something hurts it, it's going to forget about the crab for a while.
m_hEnemy = NULL;

20
dlls/buttons.cpp

@ -275,7 +275,7 @@ IMPLEMENT_SAVERESTORE( CBaseButton, CBaseToggle ) @@ -275,7 +275,7 @@ IMPLEMENT_SAVERESTORE( CBaseButton, CBaseToggle )
void CBaseButton::Precache( void )
{
char *pszSound;
const char *pszSound;
if( FBitSet( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) )// this button should spark in OFF state
{
@ -381,22 +381,22 @@ void CBaseButton::KeyValue( KeyValueData *pkvd ) @@ -381,22 +381,22 @@ void CBaseButton::KeyValue( KeyValueData *pkvd )
}
else if( FStrEq( pkvd->szKeyName, "locked_sound" ) )
{
m_bLockedSound = atof( pkvd->szValue );
m_bLockedSound = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "locked_sentence" ) )
{
m_bLockedSentence = atof( pkvd->szValue );
m_bLockedSentence = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "unlocked_sound" ) )
{
m_bUnlockedSound = atof( pkvd->szValue );
m_bUnlockedSound = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "unlocked_sentence" ) )
{
m_bUnlockedSentence = atof( pkvd->szValue );
m_bUnlockedSentence = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "sounds" ) )
@ -421,7 +421,7 @@ int CBaseButton::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl @@ -421,7 +421,7 @@ int CBaseButton::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl
SetTouch( NULL );
m_hActivator = CBaseEntity::Instance( pevAttacker );
if( m_hActivator == NULL )
if( m_hActivator == 0 )
return 0;
if( code == BUTTON_RETURN )
@ -461,7 +461,7 @@ LINK_ENTITY_TO_CLASS( func_button, CBaseButton ) @@ -461,7 +461,7 @@ LINK_ENTITY_TO_CLASS( func_button, CBaseButton )
void CBaseButton::Spawn()
{
char *pszSound;
const char *pszSound;
//----------------------------------------------------
//determine sounds for buttons
@ -527,7 +527,7 @@ void CBaseButton::Spawn() @@ -527,7 +527,7 @@ void CBaseButton::Spawn()
char *ButtonSound( int sound )
{
char *pszSound;
const char *pszSound;
switch( sound )
{
@ -869,7 +869,7 @@ LINK_ENTITY_TO_CLASS( func_rot_button, CRotButton ) @@ -869,7 +869,7 @@ LINK_ENTITY_TO_CLASS( func_rot_button, CRotButton )
void CRotButton::Spawn( void )
{
char *pszSound;
const char *pszSound;
//----------------------------------------------------
//determine sounds for buttons
//a sound of 0 should not make a sound
@ -1010,7 +1010,7 @@ void CMomentaryRotButton::Spawn( void ) @@ -1010,7 +1010,7 @@ void CMomentaryRotButton::Spawn( void )
UTIL_SetOrigin( pev, pev->origin );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
char *pszSound = ButtonSound( m_sounds );
const char *pszSound = ButtonSound( m_sounds );
PRECACHE_SOUND( pszSound );
pev->noise = ALLOC_STRING( pszSound );
m_lastUsed = 0;

4
dlls/cbase.cpp

@ -26,7 +26,7 @@ void EntvarsKeyvalue( entvars_t *pev, KeyValueData *pkvd ); @@ -26,7 +26,7 @@ void EntvarsKeyvalue( entvars_t *pev, KeyValueData *pkvd );
extern "C" void PM_Move ( struct playermove_s *ppmove, int server );
extern "C" void PM_Init ( struct playermove_s *ppmove );
extern "C" char PM_FindTextureType( char *name );
extern "C" char PM_FindTextureType( const char *name );
extern Vector VecBModelOrigin( entvars_t* pevBModel );
extern DLL_GLOBAL Vector g_vecAttackDir;
@ -739,7 +739,7 @@ int CBaseEntity::DamageDecal( int bitsDamageType ) @@ -739,7 +739,7 @@ int CBaseEntity::DamageDecal( int bitsDamageType )
// NOTE: szName must be a pointer to constant memory, e.g. "monster_class" because the entity
// will keep a pointer to it after this call.
CBaseEntity *CBaseEntity::Create( char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner )
CBaseEntity *CBaseEntity::Create( const char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner )
{
edict_t *pent;
CBaseEntity *pEntity;

7
dlls/cbase.h

@ -177,7 +177,7 @@ public: @@ -177,7 +177,7 @@ public:
virtual void AddPointsToTeam( int score, BOOL bAllowNegativeScore ) {}
virtual BOOL AddPlayerItem( CBasePlayerItem *pItem ) { return 0; }
virtual BOOL RemovePlayerItem( CBasePlayerItem *pItem ) { return 0; }
virtual int GiveAmmo( int iAmount, char *szName, int iMax ) { return -1; };
virtual int GiveAmmo( int iAmount, const char *szName, int iMax ) { return -1; };
virtual float GetDelay( void ) { return 0; }
virtual int IsMoving( void ) { return pev->velocity != g_vecZero; }
virtual void OverrideReset( void ) {}
@ -314,7 +314,7 @@ public: @@ -314,7 +314,7 @@ public:
// used by monsters that are created by the MonsterMaker
virtual void UpdateOwner( void ) { return; };
static CBaseEntity *Create( char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner = NULL );
static CBaseEntity *Create( const char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner = NULL );
virtual BOOL FBecomeProne( void ) {return FALSE;};
edict_t *edict() { return ENT( pev ); };
@ -655,8 +655,7 @@ class CSound; @@ -655,8 +655,7 @@ class CSound;
#include "basemonster.h"
char *ButtonSound( int sound ); // get string of button sound number
const char *ButtonSound( int sound ); // get string of button sound number
//
// Generic Button

26
dlls/client.cpp

@ -215,7 +215,7 @@ bool Q_IsValidUChar32( unsigned int uVal ) @@ -215,7 +215,7 @@ bool Q_IsValidUChar32( unsigned int uVal )
{
// Values > 0x10FFFF are explicitly invalid; ditto for UTF-16 surrogate halves,
// values ending in FFFE or FFFF, or values in the 0x00FDD0-0x00FDEF reserved range
return ( uVal < 0x110000u ) && ( ( uVal - 0x00D800u ) > 0x7FFu ) && ( ( uVal & 0xFFFFu ) < 0xFFFEu ) && ( ( uVal - 0x00FDD0u ) > 0x1Fu );
return ( ( uVal - 0x0u ) < 0x110000u ) && ( (uVal - 0x00D800u) > 0x7FFu ) && ( (uVal & 0xFFFFu) < 0xFFFEu ) && ( ( uVal - 0x00FDD0u ) > 0x1Fu );
}
// Decode one character from a UTF-8 encoded string. Treats 6-byte CESU-8 sequences
@ -423,7 +423,7 @@ void Host_Say( edict_t *pEntity, int teamonly ) @@ -423,7 +423,7 @@ void Host_Say( edict_t *pEntity, int teamonly )
// echo to server console
g_engfuncs.pfnServerPrint( text );
char *temp;
const char *temp;
if( teamonly )
temp = "say_team";
else
@ -744,7 +744,6 @@ void PlayerPreThink( edict_t *pEntity ) @@ -744,7 +744,6 @@ void PlayerPreThink( edict_t *pEntity )
{
//ALERT( at_console, "PreThink( %g, frametime %g )\n", gpGlobals->time, gpGlobals->frametime );
entvars_t *pev = &pEntity->v;
CBasePlayer *pPlayer = (CBasePlayer *)GET_PRIVATE( pEntity );
if( pPlayer )
@ -762,7 +761,6 @@ void PlayerPostThink( edict_t *pEntity ) @@ -762,7 +761,6 @@ void PlayerPostThink( edict_t *pEntity )
{
//ALERT( at_console, "PostThink( %g, frametime %g )\n", gpGlobals->time, gpGlobals->frametime );
entvars_t *pev = &pEntity->v;
CBasePlayer *pPlayer = (CBasePlayer *)GET_PRIVATE( pEntity );
if( pPlayer )
@ -950,7 +948,6 @@ animation right now. @@ -950,7 +948,6 @@ animation right now.
*/
void PlayerCustomization( edict_t *pEntity, customization_t *pCust )
{
entvars_t *pev = &pEntity->v;
CBasePlayer *pPlayer = (CBasePlayer *)GET_PRIVATE( pEntity );
if( !pPlayer )
@ -990,7 +987,6 @@ A spectator has joined the game @@ -990,7 +987,6 @@ A spectator has joined the game
*/
void SpectatorConnect( edict_t *pEntity )
{
entvars_t *pev = &pEntity->v;
CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE( pEntity );
if( pPlayer )
@ -1006,7 +1002,6 @@ A spectator has left the game @@ -1006,7 +1002,6 @@ A spectator has left the game
*/
void SpectatorDisconnect( edict_t *pEntity )
{
entvars_t *pev = &pEntity->v;
CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE( pEntity );
if( pPlayer )
@ -1022,7 +1017,6 @@ A spectator has sent a usercmd @@ -1022,7 +1017,6 @@ A spectator has sent a usercmd
*/
void SpectatorThink( edict_t *pEntity )
{
entvars_t *pev = &pEntity->v;
CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE( pEntity );
if( pPlayer )
@ -1235,11 +1229,11 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h @@ -1235,11 +1229,11 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h
}
state->rendermode = ent->v.rendermode;
state->renderamt = ent->v.renderamt;
state->renderamt = (int)ent->v.renderamt;
state->renderfx = ent->v.renderfx;
state->rendercolor.r = ent->v.rendercolor.x;
state->rendercolor.g = ent->v.rendercolor.y;
state->rendercolor.b = ent->v.rendercolor.z;
state->rendercolor.r = (byte)ent->v.rendercolor.x;
state->rendercolor.g = (byte)ent->v.rendercolor.y;
state->rendercolor.b = (byte)ent->v.rendercolor.z;
state->aiment = 0;
if( ent->v.aiment )
@ -1286,7 +1280,7 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h @@ -1286,7 +1280,7 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h
//state->team = ent->v.team;
state->usehull = ( ent->v.flags & FL_DUCKING ) ? 1 : 0;
state->health = ent->v.health;
state->health = (int)ent->v.health;
}
return 1;
@ -1834,7 +1828,7 @@ ConnectionlessPacket @@ -1834,7 +1828,7 @@ ConnectionlessPacket
int ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size )
{
// Parse stuff from args
int max_buffer_size = *response_buffer_size;
//int max_buffer_size = *response_buffer_size;
// Zero it out since we aren't going to respond.
// If we wanted to response, we'd write data into response_buffer
@ -1888,10 +1882,10 @@ to be created during play ( e.g., grenades, ammo packs, projectiles, corpses, et @@ -1888,10 +1882,10 @@ to be created during play ( e.g., grenades, ammo packs, projectiles, corpses, et
*/
void CreateInstancedBaselines( void )
{
int iret = 0;
/*int iret = 0;
entity_state_t state;
memset( &state, 0, sizeof(state) );
memset( &state, 0, sizeof(state) );*/
// Create any additional baselines here for things like grendates, etc.
// iret = ENGINE_INSTANCE_BASELINE( pc->pev->classname, &state );

19
dlls/combat.cpp

@ -460,11 +460,11 @@ Activity CBaseMonster::GetSmallFlinchActivity( void ) @@ -460,11 +460,11 @@ Activity CBaseMonster::GetSmallFlinchActivity( void )
{
Activity flinchActivity;
BOOL fTriedDirection;
float flDot;
//float flDot;
fTriedDirection = FALSE;
UTIL_MakeVectors( pev->angles );
flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1 );
//flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1 );
switch( m_LastHitGroup )
{
@ -576,8 +576,8 @@ Killed @@ -576,8 +576,8 @@ Killed
*/
void CBaseMonster::Killed( entvars_t *pevAttacker, int iGib )
{
unsigned int cCount = 0;
BOOL fDone = FALSE;
//unsigned int cCount = 0;
//BOOL fDone = FALSE;
if( HasMemory( bits_MEMORY_KILLED ) )
{
@ -920,7 +920,7 @@ int CBaseMonster::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, f @@ -920,7 +920,7 @@ int CBaseMonster::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, f
// enemy's last known position is somewhere down the vector that the attack came from.
if( pevInflictor )
{
if( m_hEnemy == NULL || pevInflictor == m_hEnemy->pev || !HasConditions( bits_COND_SEE_ENEMY ) )
if( m_hEnemy == 0 || pevInflictor == m_hEnemy->pev || !HasConditions( bits_COND_SEE_ENEMY ) )
{
m_vecEnemyLKP = pevInflictor->origin;
}
@ -1463,7 +1463,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin @@ -1463,7 +1463,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin
}
}
// make bullet trails
UTIL_BubbleTrail( vecSrc, tr.vecEndPos, ( flDistance * tr.flFraction ) / 64.0 );
UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0 );
}
ApplyMultiDamage( pev, pevAttacker );
}
@ -1483,7 +1483,8 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi @@ -1483,7 +1483,8 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi
TraceResult tr;
Vector vecRight = gpGlobals->v_right;
Vector vecUp = gpGlobals->v_up;
float x, y, z;
float x = 0.0f, y = 0.0f;
float z;
if( pevAttacker == NULL )
pevAttacker = pev; // the default attacker is ourselves
@ -1497,7 +1498,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi @@ -1497,7 +1498,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi
// get circular gaussian spread
x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5, 0.5 );
y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5, 0.5 );
z = x * x + y * y;
//z = x * x + y * y;
Vector vecDir = vecDirShooting +
x * vecSpread.x * vecRight +
@ -1548,7 +1549,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi @@ -1548,7 +1549,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi
}
}
// make bullet trails
UTIL_BubbleTrail( vecSrc, tr.vecEndPos, ( flDistance * tr.flFraction ) / 64.0 );
UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0 ) );
}
ApplyMultiDamage( pev, pevAttacker );

9
dlls/controller.cpp

@ -614,7 +614,7 @@ void CController::RunTask( Task_t *pTask ) @@ -614,7 +614,7 @@ void CController::RunTask( Task_t *pTask )
Vector vecSrc = vecHand + pev->velocity * ( m_flShootTime - gpGlobals->time );
Vector vecDir;
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
if( HasConditions( bits_COND_SEE_ENEMY ) )
{
@ -707,7 +707,7 @@ Schedule_t *CController::GetSchedule( void ) @@ -707,7 +707,7 @@ Schedule_t *CController::GetSchedule( void )
{
case MONSTERSTATE_COMBAT:
{
Vector vecTmp = Intersect( Vector( 0, 0, 0 ), Vector( 100, 4, 7 ), Vector( 2, 10, -3 ), 20.0 );
// Vector vecTmp = Intersect( Vector( 0, 0, 0 ), Vector( 100, 4, 7 ), Vector( 2, 10, -3 ), 20.0 );
// dead enemy
if( HasConditions( bits_COND_LIGHT_DAMAGE ) )
@ -1095,7 +1095,6 @@ class CControllerHeadBall : public CBaseMonster @@ -1095,7 +1095,6 @@ class CControllerHeadBall : public CBaseMonster
void EXPORT BounceTouch( CBaseEntity *pOther );
void MovetoTarget( Vector vecTarget );
void Crawl( void );
int m_iTrail;
int m_flNextAttack;
Vector m_vecIdeal;
EHANDLE m_hOwner;
@ -1160,7 +1159,7 @@ void CControllerHeadBall::HuntThink( void ) @@ -1160,7 +1159,7 @@ void CControllerHeadBall::HuntThink( void )
MESSAGE_END();
// check world boundaries
if( gpGlobals->time - pev->dmgtime > 5 || pev->renderamt < 64 || m_hEnemy == NULL || m_hOwner == NULL || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 )
if( gpGlobals->time - pev->dmgtime > 5 || pev->renderamt < 64 || m_hEnemy == 0 || m_hOwner == 0 || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 )
{
SetTouch( NULL );
UTIL_Remove( this );
@ -1340,7 +1339,7 @@ void CControllerZapBall::ExplodeTouch( CBaseEntity *pOther ) @@ -1340,7 +1339,7 @@ void CControllerZapBall::ExplodeTouch( CBaseEntity *pOther )
entvars_t *pevOwner;
if( m_hOwner != NULL )
if( m_hOwner != 0 )
{
pevOwner = m_hOwner->pev;
}

3
dlls/crossbow.cpp

@ -425,10 +425,11 @@ void CCrossbow::FireBolt() @@ -425,10 +425,11 @@ void CCrossbow::FireBolt()
UTIL_MakeVectors( anglesAim );
anglesAim.x = -anglesAim.x;
#ifndef CLIENT_DLL
Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2;
Vector vecDir = gpGlobals->v_forward;
#ifndef CLIENT_DLL
CCrossbowBolt *pBolt = CCrossbowBolt::BoltCreate();
pBolt->pev->origin = vecSrc;
pBolt->pev->angles = anglesAim;

4
dlls/crowbar.cpp

@ -183,7 +183,7 @@ int CCrowbar::Swing( int fFirst ) @@ -183,7 +183,7 @@ int CCrowbar::Swing( int fFirst )
#endif
PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usCrowbar,
0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0, 0, 0,
0.0, 0, 0.0 );
0, 0, 0 );
if( tr.flFraction >= 1.0 )
{
@ -294,7 +294,7 @@ int CCrowbar::Swing( int fFirst ) @@ -294,7 +294,7 @@ int CCrowbar::Swing( int fFirst )
m_trHit = tr;
}
m_pPlayer->m_iWeaponVolume = flVol * CROWBAR_WALLHIT_VOLUME;
m_pPlayer->m_iWeaponVolume = (int)( flVol * CROWBAR_WALLHIT_VOLUME );
#endif
m_flNextPrimaryAttack = GetNextAttackDelay( 0.25 );

2
dlls/decals.h

@ -66,7 +66,7 @@ enum decal_e @@ -66,7 +66,7 @@ enum decal_e
typedef struct
{
char *name;
const char *name;
int index;
} DLL_DECALLIST;

24
dlls/doors.cpp

@ -189,42 +189,42 @@ void CBaseDoor::KeyValue( KeyValueData *pkvd ) @@ -189,42 +189,42 @@ void CBaseDoor::KeyValue( KeyValueData *pkvd )
{
if( FStrEq( pkvd->szKeyName, "skin" ) )//skin is used for content type
{
pev->skin = atof( pkvd->szValue );
pev->skin = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "movesnd" ) )
{
m_bMoveSnd = atof( pkvd->szValue );
m_bMoveSnd = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "stopsnd" ) )
{
m_bStopSnd = atof( pkvd->szValue );
m_bStopSnd = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "healthvalue" ) )
{
m_bHealthValue = atof( pkvd->szValue );
m_bHealthValue = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "locked_sound" ) )
{
m_bLockedSound = atof( pkvd->szValue );
m_bLockedSound = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "locked_sentence" ) )
{
m_bLockedSentence = atof( pkvd->szValue );
m_bLockedSentence = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "unlocked_sound" ) )
{
m_bUnlockedSound = atof( pkvd->szValue );
m_bUnlockedSound = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "unlocked_sentence" ) )
{
m_bUnlockedSentence = atof( pkvd->szValue );
m_bUnlockedSentence = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "WaveHeight" ) )
@ -328,7 +328,7 @@ void CBaseDoor::SetToggleState( int state ) @@ -328,7 +328,7 @@ void CBaseDoor::SetToggleState( int state )
void CBaseDoor::Precache( void )
{
char *pszSound;
const char *pszSound;
// set the door's "in-motion" sound
switch( m_bMoveSnd )
@ -581,7 +581,7 @@ int CBaseDoor::DoorActivate() @@ -581,7 +581,7 @@ int CBaseDoor::DoorActivate()
else
{
// door should open
if( m_hActivator != NULL && m_hActivator->IsPlayer() )
if( m_hActivator != 0 && m_hActivator->IsPlayer() )
{
// give health if player opened the door (medikit)
//VARS( m_eoActivator )->health += m_bHealthValue;
@ -623,7 +623,7 @@ void CBaseDoor::DoorGoUp( void ) @@ -623,7 +623,7 @@ void CBaseDoor::DoorGoUp( void )
{
float sign = 1.0;
if( m_hActivator != NULL )
if( m_hActivator != 0 )
{
pevActivator = m_hActivator->pev;
@ -1070,7 +1070,7 @@ void CMomentaryDoor::KeyValue( KeyValueData *pkvd ) @@ -1070,7 +1070,7 @@ void CMomentaryDoor::KeyValue( KeyValueData *pkvd )
if( FStrEq( pkvd->szKeyName, "movesnd" ) )
{
m_bMoveSnd = atof( pkvd->szValue );
m_bMoveSnd = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "stopsnd" ) )

18
dlls/effects.cpp

@ -75,7 +75,7 @@ void CBubbling::Spawn( void ) @@ -75,7 +75,7 @@ void CBubbling::Spawn( void )
pev->solid = SOLID_NOT; // Remove model & collisions
pev->renderamt = 0; // The engine won't draw this model if this is set to 0 and blending is on
pev->rendermode = kRenderTransTexture;
int speed = pev->speed > 0 ? pev->speed : -pev->speed;
int speed = fabs( pev->speed );
// HACKHACK!!! - Speed in rendercolor
pev->rendercolor.x = speed >> 8;
@ -701,7 +701,7 @@ void CLightning::StrikeThink( void ) @@ -701,7 +701,7 @@ void CLightning::StrikeThink( void )
WRITE_BYTE( (int)pev->rendercolor.x ); // r, g, b
WRITE_BYTE( (int)pev->rendercolor.y ); // r, g, b
WRITE_BYTE( (int)pev->rendercolor.z ); // r, g, b
WRITE_BYTE( pev->renderamt ); // brightness
WRITE_BYTE( (int)pev->renderamt ); // brightness
WRITE_BYTE( m_speed ); // speed
MESSAGE_END();
DoSparks( pStart->pev->origin, pEnd->pev->origin );
@ -763,7 +763,7 @@ void CLightning::Zap( const Vector &vecSrc, const Vector &vecDest ) @@ -763,7 +763,7 @@ void CLightning::Zap( const Vector &vecSrc, const Vector &vecDest )
WRITE_BYTE( (int)pev->rendercolor.x ); // r, g, b
WRITE_BYTE( (int)pev->rendercolor.y ); // r, g, b
WRITE_BYTE( (int)pev->rendercolor.z ); // r, g, b
WRITE_BYTE( pev->renderamt ); // brightness
WRITE_BYTE( (int)pev->renderamt ); // brightness
WRITE_BYTE( m_speed ); // speed
MESSAGE_END();
#else
@ -944,7 +944,7 @@ void CLaser::Spawn( void ) @@ -944,7 +944,7 @@ void CLaser::Spawn( void )
m_pSprite = NULL;
if( m_pSprite )
m_pSprite->SetTransparency( kRenderGlow, pev->rendercolor.x, pev->rendercolor.y, pev->rendercolor.z, pev->renderamt, pev->renderfx );
m_pSprite->SetTransparency( kRenderGlow, (int)pev->rendercolor.x, (int)pev->rendercolor.y, (int)pev->rendercolor.z, (int)pev->renderamt, (int)pev->renderfx );
if( pev->targetname && !( pev->spawnflags & SF_BEAM_STARTON ) )
TurnOff();
@ -1619,7 +1619,7 @@ void CTestEffect::TestThink( void ) @@ -1619,7 +1619,7 @@ void CTestEffect::TestThink( void )
for( i = 0; i < m_iBeam; i++ )
{
t = ( gpGlobals->time - m_flBeamTime[i] ) / ( 3 + m_flStartTime - m_flBeamTime[i] );
m_pBeam[i]->SetBrightness( 255 * t );
m_pBeam[i]->SetBrightness( (int)( 255 * t ) );
// m_pBeam[i]->SetScrollRate( 20 * t );
}
pev->nextthink = gpGlobals->time + 0.1;
@ -1749,9 +1749,9 @@ Vector CBlood::BloodPosition( CBaseEntity *pActivator ) @@ -1749,9 +1749,9 @@ Vector CBlood::BloodPosition( CBaseEntity *pActivator )
void CBlood::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
if( pev->spawnflags & SF_BLOOD_STREAM )
UTIL_BloodStream( BloodPosition( pActivator ), Direction(), ( Color() == BLOOD_COLOR_RED ) ? 70 : Color(), BloodAmount() );
UTIL_BloodStream( BloodPosition( pActivator ), Direction(), ( Color() == BLOOD_COLOR_RED ) ? 70 : Color(), (int)BloodAmount() );
else
UTIL_BloodDrips( BloodPosition( pActivator ), Direction(), Color(), BloodAmount() );
UTIL_BloodDrips( BloodPosition( pActivator ), Direction(), Color(), (int)BloodAmount() );
if( pev->spawnflags & SF_BLOOD_DECAL )
{
@ -1947,12 +1947,12 @@ void CFade::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType @@ -1947,12 +1947,12 @@ void CFade::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType
{
if( pActivator->IsNetClient() )
{
UTIL_ScreenFade( pActivator, pev->rendercolor, Duration(), HoldTime(), pev->renderamt, fadeFlags );
UTIL_ScreenFade( pActivator, pev->rendercolor, Duration(), HoldTime(), (int)pev->renderamt, fadeFlags );
}
}
else
{
UTIL_ScreenFadeAll( pev->rendercolor, Duration(), HoldTime(), pev->renderamt, fadeFlags );
UTIL_ScreenFadeAll( pev->rendercolor, Duration(), HoldTime(), (int)pev->renderamt, fadeFlags );
}
SUB_UseTargets( this, USE_TOGGLE, 0 );
}

8
dlls/effects.h

@ -238,7 +238,7 @@ public: @@ -238,7 +238,7 @@ public:
inline int GetWidth( void )
{
return pev->scale;
return (int)pev->scale;
}
inline int GetNoise( void )
@ -255,17 +255,17 @@ public: @@ -255,17 +255,17 @@ public:
inline int GetBrightness( void )
{
return pev->renderamt;
return (int)pev->renderamt;
}
inline int GetFrame( void )
{
return pev->frame;
return (int)pev->frame;
}
inline int GetScrollRate( void )
{
return pev->animtime;
return (int)pev->animtime;
}
// Call after you change start/end positions

10
dlls/egon.cpp

@ -270,7 +270,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) @@ -270,7 +270,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir )
}
}
#endif
float timedist;
float timedist = 0.0f;
switch( m_fireMode )
{
@ -380,13 +380,13 @@ void CEgon::UpdateEffect( const Vector &startPoint, const Vector &endPoint, floa @@ -380,13 +380,13 @@ void CEgon::UpdateEffect( const Vector &startPoint, const Vector &endPoint, floa
}
m_pBeam->SetStartPos( endPoint );
m_pBeam->SetBrightness( 255 - ( timeBlend * 180 ) );
m_pBeam->SetWidth( 40 - ( timeBlend * 20 ) );
m_pBeam->SetBrightness( (int)( 255 - ( timeBlend * 180 )) );
m_pBeam->SetWidth( (int)( 40 - ( timeBlend * 20 ) ) );
if( m_fireMode == FIRE_WIDE )
m_pBeam->SetColor( 30 + ( 25 * timeBlend ), 30 + ( 30 * timeBlend ), 64 + 80 * fabs( sin( gpGlobals->time * 10 ) ) );
m_pBeam->SetColor( (int)( 30 + ( 25 * timeBlend ) ), (int)( 30 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time * 10 ) ) ) );
else
m_pBeam->SetColor( 60 + ( 25 * timeBlend ), 120 + ( 30 * timeBlend ), 64 + 80 * fabs( sin( gpGlobals->time *10 ) ) );
m_pBeam->SetColor( (int)( 60 + ( 25 * timeBlend ) ), (int)( 120 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time *10 ) ) ) );
UTIL_SetOrigin( m_pSprite->pev, endPoint );
m_pSprite->pev->frame += 8 * gpGlobals->frametime;

8
dlls/enginecallback.h

@ -14,10 +14,18 @@ @@ -14,10 +14,18 @@
****/
#ifndef ENGINECALLBACK_H
#define ENGINECALLBACK_H
#ifdef _WIN32
#ifndef __MINGW32__
#pragma once
#endif /* not __MINGW32__ */
#endif
#include "event_flags.h"
// Fix warning in MSVC8
#undef SERVER_EXECUTE
// Must be provided by user of this code
extern enginefuncs_t g_engfuncs;

6
dlls/extdll.h

@ -25,11 +25,13 @@ @@ -25,11 +25,13 @@
#endif
// Silence certain warnings
#ifdef _MSC_VER
#pragma warning(disable : 4244) // int or float down-conversion
#pragma warning(disable : 4305) // int or float data truncation
#pragma warning(disable : 4201) // nameless struct/union
#pragma warning(disable : 4514) // unreferenced inline function removed
#pragma warning(disable : 4100) // unreferenced formal parameter
#endif
// Prevent tons of unused windows definitions
#ifdef _WIN32
@ -42,8 +44,12 @@ @@ -42,8 +44,12 @@
#include "windows.h"
#undef HSPRITE
#else // _WIN32
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
typedef unsigned int ULONG;
typedef unsigned char BYTE;
typedef int BOOL;

13
dlls/func_break.cpp

@ -104,7 +104,7 @@ void CBreakable::KeyValue( KeyValueData* pkvd ) @@ -104,7 +104,7 @@ void CBreakable::KeyValue( KeyValueData* pkvd )
else if( FStrEq( pkvd->szKeyName, "spawnobject" ) )
{
int object = atoi( pkvd->szValue );
if( object > 0 && object < ARRAYSIZE( pSpawnObjects ) )
if( object > 0 && object < (int)ARRAYSIZE( pSpawnObjects ) )
m_iszSpawnObject = MAKE_STRING( pSpawnObjects[object] );
pkvd->fHandled = TRUE;
}
@ -353,7 +353,7 @@ void CBreakable::DamageSound( void ) @@ -353,7 +353,7 @@ void CBreakable::DamageSound( void )
{
int pitch;
float fvol;
char *rgpsz[6];
const char *rgpsz[6];
int i = 0;
int material = m_Material;
@ -574,7 +574,6 @@ void CBreakable::Die( void ) @@ -574,7 +574,6 @@ void CBreakable::Die( void )
{
Vector vecSpot;// shard origin
Vector vecVelocity;// shard velocity
CBaseEntity *pEntity = NULL;
char cFlag = 0;
int pitch;
float fvol;
@ -794,7 +793,7 @@ public: @@ -794,7 +793,7 @@ public:
static TYPEDESCRIPTION m_SaveData[];
static char *m_soundNames[3];
static const char *m_soundNames[3];
int m_lastSound; // no need to save/restore, just keeps the same sound from playing twice in a row
float m_maxSpeed;
float m_soundTime;
@ -810,7 +809,7 @@ IMPLEMENT_SAVERESTORE( CPushable, CBreakable ) @@ -810,7 +809,7 @@ IMPLEMENT_SAVERESTORE( CPushable, CBreakable )
LINK_ENTITY_TO_CLASS( func_pushable, CPushable )
char *CPushable::m_soundNames[3] =
const char *CPushable::m_soundNames[3] =
{
"debris/pushbox1.wav",
"debris/pushbox2.wav",
@ -839,7 +838,7 @@ void CPushable::Spawn( void ) @@ -839,7 +838,7 @@ void CPushable::Spawn( void )
UTIL_SetOrigin( pev, pev->origin );
// Multiply by area of the box's cross-section (assume 1000 units^3 standard volume)
pev->skin = ( pev->skin * ( pev->maxs.x - pev->mins.x ) * ( pev->maxs.y - pev->mins.y ) ) * 0.0005;
pev->skin = (int)( ( pev->skin * ( pev->maxs.x - pev->mins.x ) * ( pev->maxs.y - pev->mins.y ) ) * 0.0005 );
m_soundTime = 0;
}
@ -882,7 +881,7 @@ void CPushable::KeyValue( KeyValueData *pkvd ) @@ -882,7 +881,7 @@ void CPushable::KeyValue( KeyValueData *pkvd )
}
else if( FStrEq( pkvd->szKeyName, "buoyancy" ) )
{
pev->skin = atof( pkvd->szValue );
pev->skin = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else

24
dlls/func_tank.cpp

@ -190,7 +190,7 @@ void CFuncTank::Spawn( void ) @@ -190,7 +190,7 @@ void CFuncTank::Spawn( void )
if( m_fireRate <= 0 )
m_fireRate = 1;
if( m_spread > MAX_FIRING_SPREADS )
if( m_spread > (int)MAX_FIRING_SPREADS )
m_spread = 0;
pev->oldorigin = pev->origin;
@ -328,7 +328,7 @@ BOOL CFuncTank::OnControls( entvars_t *pevTest ) @@ -328,7 +328,7 @@ BOOL CFuncTank::OnControls( entvars_t *pevTest )
if( !( pev->spawnflags & SF_TANK_CANCONTROL ) )
return FALSE;
Vector offset = pevTest->origin - pev->origin;
//Vector offset = pevTest->origin - pev->origin;
if( ( m_vecControllerUsePos - pevTest->origin ).Length() < 30 )
return TRUE;
@ -476,9 +476,9 @@ void CFuncTank::TrackTarget( void ) @@ -476,9 +476,9 @@ void CFuncTank::TrackTarget( void )
{
TraceResult tr;
edict_t *pPlayer = FIND_CLIENT_IN_PVS( edict() );
BOOL updateTime = FALSE, lineOfSight;
BOOL updateTime = FALSE;
Vector angles, direction, targetPosition, barrelEnd;
edict_t *pTarget;
edict_t *pTarget = NULL;
// Get a position to aim for
if( m_pController )
@ -515,12 +515,8 @@ void CFuncTank::TrackTarget( void ) @@ -515,12 +515,8 @@ void CFuncTank::TrackTarget( void )
UTIL_TraceLine( barrelEnd, targetPosition, dont_ignore_monsters, edict(), &tr );
lineOfSight = FALSE;
// No line of sight, don't track
if( tr.flFraction == 1.0 || tr.pHit == pTarget )
{
lineOfSight = TRUE;
CBaseEntity *pInstance = CBaseEntity::Instance(pTarget);
if( InRange( range ) && pInstance && pInstance->IsAlive() )
{
@ -644,7 +640,7 @@ void CFuncTank::Fire( const Vector &barrelEnd, const Vector &forward, entvars_t @@ -644,7 +640,7 @@ void CFuncTank::Fire( const Vector &barrelEnd, const Vector &forward, entvars_t
{
CSprite *pSprite = CSprite::SpriteCreate( STRING( m_iszSpriteSmoke ), barrelEnd, TRUE );
pSprite->AnimateAndDie( RANDOM_FLOAT( 15.0, 20.0 ) );
pSprite->SetTransparency( kRenderTransAlpha, pev->rendercolor.x, pev->rendercolor.y, pev->rendercolor.z, 255, kRenderFxNone );
pSprite->SetTransparency( kRenderTransAlpha, (int)pev->rendercolor.x, (int)pev->rendercolor.y, (int)pev->rendercolor.z, 255, kRenderFxNone );
pSprite->pev->velocity.z = RANDOM_FLOAT( 40, 80 );
pSprite->SetScale( m_spriteScale );
}
@ -714,7 +710,7 @@ void CFuncTankGun::Fire( const Vector &barrelEnd, const Vector &forward, entvars @@ -714,7 +710,7 @@ void CFuncTankGun::Fire( const Vector &barrelEnd, const Vector &forward, entvars
// FireBullets needs gpGlobals->v_up, etc.
UTIL_MakeAimVectors( pev->angles );
int bulletCount = ( gpGlobals->time - m_fireLast ) * m_fireRate;
int bulletCount = (int)( ( gpGlobals->time - m_fireLast ) * m_fireRate );
if( bulletCount > 0 )
{
for( i = 0; i < bulletCount; i++ )
@ -835,7 +831,7 @@ void CFuncTankLaser::Fire( const Vector &barrelEnd, const Vector &forward, entva @@ -835,7 +831,7 @@ void CFuncTankLaser::Fire( const Vector &barrelEnd, const Vector &forward, entva
// TankTrace needs gpGlobals->v_up, etc.
UTIL_MakeAimVectors( pev->angles );
int bulletCount = ( gpGlobals->time - m_fireLast ) * m_fireRate;
int bulletCount = (int)( ( gpGlobals->time - m_fireLast ) * m_fireRate );
if( bulletCount )
{
for( i = 0; i < bulletCount; i++ )
@ -879,12 +875,12 @@ void CFuncTankRocket::Fire( const Vector &barrelEnd, const Vector &forward, entv @@ -879,12 +875,12 @@ void CFuncTankRocket::Fire( const Vector &barrelEnd, const Vector &forward, entv
if( m_fireLast != 0 )
{
int bulletCount = ( gpGlobals->time - m_fireLast ) * m_fireRate;
int bulletCount = (int)( ( gpGlobals->time - m_fireLast ) * m_fireRate );
if( bulletCount > 0 )
{
for( i = 0; i < bulletCount; i++ )
{
CBaseEntity *pRocket = CBaseEntity::Create( "rpg_rocket", barrelEnd, pev->angles, edict() );
CBaseEntity::Create( "rpg_rocket", barrelEnd, pev->angles, edict() );
}
CFuncTank::Fire( barrelEnd, forward, pev );
}
@ -917,7 +913,7 @@ void CFuncTankMortar::Fire( const Vector &barrelEnd, const Vector &forward, entv @@ -917,7 +913,7 @@ void CFuncTankMortar::Fire( const Vector &barrelEnd, const Vector &forward, entv
{
if( m_fireLast != 0 )
{
int bulletCount = ( gpGlobals->time - m_fireLast ) * m_fireRate;
int bulletCount = (int)( ( gpGlobals->time - m_fireLast ) * m_fireRate );
// Only create 1 explosion
if( bulletCount > 0 )
{

3
dlls/gargantua.cpp

@ -538,7 +538,6 @@ void CGargantua::FlameControls( float angleX, float angleY ) @@ -538,7 +538,6 @@ void CGargantua::FlameControls( float angleX, float angleY )
void CGargantua::FlameUpdate( void )
{
int i;
static float offset[2] = { 60, -60 };
TraceResult trace;
Vector vecStart, angleGun;
BOOL streaks = FALSE;
@ -759,7 +758,7 @@ void CGargantua::Spawn() @@ -759,7 +758,7 @@ void CGargantua::Spawn()
//=========================================================
void CGargantua::Precache()
{
int i;
size_t i;
PRECACHE_MODEL( "models/garg.mdl" );
PRECACHE_MODEL( GARG_EYE_SPRITE_NAME );

9
dlls/gauss.cpp

@ -259,7 +259,7 @@ void CGauss::SecondaryAttack() @@ -259,7 +259,7 @@ void CGauss::SecondaryAttack()
m_pPlayer->m_flNextAmmoBurn = 1000;
}
int pitch = ( gpGlobals->time - m_pPlayer->m_flStartCharge ) * ( 150 / GetFullChargeTime() ) + 100;
int pitch = (int)( ( gpGlobals->time - m_pPlayer->m_flStartCharge ) * ( 150 / GetFullChargeTime() ) + 100 );
if( pitch > 250 )
pitch = 250;
@ -359,11 +359,11 @@ void CGauss::StartFire( void ) @@ -359,11 +359,11 @@ void CGauss::StartFire( void )
void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage )
{
m_pPlayer->m_iWeaponVolume = GAUSS_PRIMARY_FIRE_VOLUME;
TraceResult tr, beam_tr;
#ifndef CLIENT_DLL
Vector vecSrc = vecOrigSrc;
Vector vecDest = vecSrc + vecDir * 8192;
edict_t *pentIgnore;
TraceResult tr, beam_tr;
float flMaxFrac = 1.0;
int nTotal = 0;
int fHasPunched = 0;
@ -371,8 +371,7 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) @@ -371,8 +371,7 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage )
int nMaxHits = 10;
pentIgnore = ENT( m_pPlayer->pev );
#ifdef CLIENT_DLL
#else
if( m_fPrimaryFire == false )
g_irunninggausspred = true;
#endif

2
dlls/genericmonster.cpp

@ -88,7 +88,7 @@ void CGenericMonster::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -88,7 +88,7 @@ void CGenericMonster::HandleAnimEvent( MonsterEvent_t *pEvent )
//=========================================================
int CGenericMonster::ISoundMask( void )
{
return NULL;
return 0;
}
//=========================================================

10
dlls/ggrenade.cpp

@ -49,7 +49,7 @@ void CGrenade::Explode( Vector vecSrc, Vector vecAim ) @@ -49,7 +49,7 @@ void CGrenade::Explode( Vector vecSrc, Vector vecAim )
// UNDONE: temporary scorching for PreAlpha - find a less sleazy permenant solution.
void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType )
{
float flRndSound;// sound randomizer
// float flRndSound;// sound randomizer
pev->model = iStringNull;//invisible
pev->solid = SOLID_NOT;// intangible
@ -102,7 +102,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) @@ -102,7 +102,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType )
UTIL_DecalTrace( pTrace, DECAL_SCORCH2 );
}
flRndSound = RANDOM_FLOAT( 0, 1 );
//flRndSound = RANDOM_FLOAT( 0, 1 );
switch( RANDOM_LONG( 0, 2 ) )
{
@ -144,7 +144,7 @@ void CGrenade::Smoke( void ) @@ -144,7 +144,7 @@ void CGrenade::Smoke( void )
WRITE_COORD( pev->origin.y );
WRITE_COORD( pev->origin.z );
WRITE_SHORT( g_sModelIndexSmoke );
WRITE_BYTE( ( pev->dmg - 50 ) * 0.80 ); // scale * 10
WRITE_BYTE( (int)( ( pev->dmg - 50 ) * 0.80 ) ); // scale * 10
WRITE_BYTE( 12 ); // framerate
MESSAGE_END();
}
@ -207,7 +207,7 @@ void CGrenade::DangerSoundThink( void ) @@ -207,7 +207,7 @@ void CGrenade::DangerSoundThink( void )
return;
}
CSoundEnt::InsertSound ( bits_SOUND_DANGER, pev->origin + pev->velocity * 0.5, pev->velocity.Length(), 0.2 );
CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin + pev->velocity * 0.5, (int)pev->velocity.Length(), 0.2 );
pev->nextthink = gpGlobals->time + 0.2;
if( pev->waterlevel != 0 )
@ -253,7 +253,7 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) @@ -253,7 +253,7 @@ void CGrenade::BounceTouch( CBaseEntity *pOther )
// go ahead and emit the danger sound.
// register a radius louder than the explosion, so we make sure everyone gets out of the way
CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin, pev->dmg / 0.4, 0.3 );
CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin, (int)( pev->dmg / 0.4 ), 0.3 );
m_fRegisteredSound = TRUE;
}

8
dlls/gman.cpp

@ -109,7 +109,7 @@ void CGMan::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -109,7 +109,7 @@ void CGMan::HandleAnimEvent( MonsterEvent_t *pEvent )
//=========================================================
int CGMan::ISoundMask( void )
{
return NULL;
return 0;
}
//=========================================================
@ -149,7 +149,7 @@ void CGMan::StartTask( Task_t *pTask ) @@ -149,7 +149,7 @@ void CGMan::StartTask( Task_t *pTask )
switch( pTask->iTask )
{
case TASK_WAIT:
if( m_hPlayer == NULL )
if( m_hPlayer == 0 )
{
m_hPlayer = UTIL_FindEntityByClassname( NULL, "player" );
}
@ -164,7 +164,7 @@ void CGMan::RunTask( Task_t *pTask ) @@ -164,7 +164,7 @@ void CGMan::RunTask( Task_t *pTask )
{
case TASK_WAIT:
// look at who I'm talking to
if( m_flTalkTime > gpGlobals->time && m_hTalkTarget != NULL )
if( m_flTalkTime > gpGlobals->time && m_hTalkTarget != 0 )
{
float yaw = VecToYaw( m_hTalkTarget->pev->origin - pev->origin ) - pev->angles.y;
@ -177,7 +177,7 @@ void CGMan::RunTask( Task_t *pTask ) @@ -177,7 +177,7 @@ void CGMan::RunTask( Task_t *pTask )
SetBoneController( 0, yaw );
}
// look at player, but only if playing a "safe" idle animation
else if( m_hPlayer != NULL && pev->sequence == 0 )
else if( m_hPlayer != 0 && pev->sequence == 0 )
{
float yaw = VecToYaw( m_hPlayer->pev->origin - pev->origin ) - pev->angles.y;

6
dlls/h_battery.cpp

@ -91,7 +91,7 @@ void CRecharge::Spawn() @@ -91,7 +91,7 @@ void CRecharge::Spawn()
UTIL_SetOrigin( pev, pev->origin ); // set size and link into world
UTIL_SetSize( pev, pev->mins, pev->maxs );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
m_iJuice = gSkillData.suitchargerCapacity;
m_iJuice = (int)gSkillData.suitchargerCapacity;
pev->frame = 0;
}
@ -172,7 +172,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use @@ -172,7 +172,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
void CRecharge::Recharge( void )
{
m_iJuice = gSkillData.suitchargerCapacity;
m_iJuice = (int)gSkillData.suitchargerCapacity;
pev->frame = 0;
SetThink( &CBaseEntity::SUB_DoNothing );
}
@ -185,7 +185,7 @@ void CRecharge::Off( void ) @@ -185,7 +185,7 @@ void CRecharge::Off( void )
m_iOn = 0;
if( ( !m_iJuice ) && ( ( m_iReactivate = g_pGameRules->FlHEVChargerRechargeTime() ) > 0 ) )
if( ( !m_iJuice ) && ( ( m_iReactivate = (int)g_pGameRules->FlHEVChargerRechargeTime() ) > 0 ) )
{
pev->nextthink = pev->ltime + m_iReactivate;
SetThink( &CRecharge::Recharge );

4
dlls/h_cine.cpp

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
class CLegacyCineMonster : public CBaseMonster
{
public:
void CineSpawn( char *szModel );
void CineSpawn( const char *szModel );
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
void EXPORT CineThink( void );
void Pain( void );
@ -103,7 +103,7 @@ LINK_ENTITY_TO_CLASS( monster_cine3_barney, CCine3Barney ) @@ -103,7 +103,7 @@ LINK_ENTITY_TO_CLASS( monster_cine3_barney, CCine3Barney )
// ********** Scientist SPAWN **********
//
void CLegacyCineMonster :: CineSpawn( char *szModel )
void CLegacyCineMonster :: CineSpawn( const char *szModel )
{
PRECACHE_MODEL(szModel);
SET_MODEL(ENT(pev), szModel);

6
dlls/h_cycler.cpp

@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
class CCycler : public CBaseMonster
{
public:
void GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax);
void GenericCyclerSpawn( const char *szModel, Vector vecMin, Vector vecMax );
virtual int ObjectCaps( void ) { return ( CBaseEntity::ObjectCaps() | FCAP_IMPULSE_USE ); }
int TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType );
void Spawn( void );
@ -92,7 +92,7 @@ void CCyclerProbe::Spawn( void ) @@ -92,7 +92,7 @@ void CCyclerProbe::Spawn( void )
}
// Cycler member functions
void CCycler::GenericCyclerSpawn( char *szModel, Vector vecMin, Vector vecMax )
void CCycler::GenericCyclerSpawn( const char *szModel, Vector vecMin, Vector vecMax )
{
if( !szModel || !*szModel )
{
@ -406,7 +406,7 @@ void CWreckage::Spawn( void ) @@ -406,7 +406,7 @@ void CWreckage::Spawn( void )
}
// pev->scale = 5.0;
m_flStartTime = gpGlobals->time;
m_flStartTime = (int)gpGlobals->time;
}
void CWreckage::Precache()

6
dlls/hassassin.cpp

@ -185,7 +185,7 @@ void CHAssassin::SetYawSpeed( void ) @@ -185,7 +185,7 @@ void CHAssassin::SetYawSpeed( void )
//=========================================================
void CHAssassin::Shoot( void )
{
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
return;
}
@ -597,7 +597,7 @@ IMPLEMENT_CUSTOM_SCHEDULES( CHAssassin, CBaseMonster ) @@ -597,7 +597,7 @@ IMPLEMENT_CUSTOM_SCHEDULES( CHAssassin, CBaseMonster )
//=========================================================
BOOL CHAssassin::CheckMeleeAttack1( float flDot, float flDist )
{
if( m_flNextJump < gpGlobals->time && ( flDist <= 128 || HasMemory( bits_MEMORY_BADJUMP ) ) && m_hEnemy != NULL )
if( m_flNextJump < gpGlobals->time && ( flDist <= 128 || HasMemory( bits_MEMORY_BADJUMP ) ) && m_hEnemy != 0 )
{
TraceResult tr;
@ -687,7 +687,7 @@ void CHAssassin::RunAI( void ) @@ -687,7 +687,7 @@ void CHAssassin::RunAI( void )
// always visible if moving
// always visible is not on hard
if( g_iSkillLevel != SKILL_HARD || m_hEnemy == NULL || pev->deadflag != DEAD_NO || m_Activity == ACT_RUN || m_Activity == ACT_WALK || !( pev->flags & FL_ONGROUND ) )
if( g_iSkillLevel != SKILL_HARD || m_hEnemy == 0 || pev->deadflag != DEAD_NO || m_Activity == ACT_RUN || m_Activity == ACT_WALK || !( pev->flags & FL_ONGROUND ) )
m_iTargetRanderamt = 255;
else
m_iTargetRanderamt = 20;

4
dlls/headcrab.cpp

@ -226,7 +226,7 @@ void CHeadCrab::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -226,7 +226,7 @@ void CHeadCrab::HandleAnimEvent( MonsterEvent_t *pEvent )
UTIL_MakeVectors( pev->angles );
Vector vecJumpDir;
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
float gravity = g_psv_gravity->value;
if( gravity <= 1 )
@ -538,7 +538,7 @@ Schedule_t *CBabyCrab::GetScheduleOfType( int Type ) @@ -538,7 +538,7 @@ Schedule_t *CBabyCrab::GetScheduleOfType( int Type )
switch( Type )
{
case SCHED_FAIL: // If you fail, try to jump!
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
return slHCRangeAttack1Fast;
break;
case SCHED_RANGE_ATTACK1:

6
dlls/healthkit.cpp

@ -159,7 +159,7 @@ void CWallHealth::Spawn() @@ -159,7 +159,7 @@ void CWallHealth::Spawn()
UTIL_SetOrigin( pev, pev->origin ); // set size and link into world
UTIL_SetSize( pev, pev->mins, pev->maxs );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
m_iJuice = gSkillData.healthchargerCapacity;
m_iJuice = (int)gSkillData.healthchargerCapacity;
pev->frame = 0;
}
@ -230,7 +230,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u @@ -230,7 +230,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u
void CWallHealth::Recharge( void )
{
EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/medshot4.wav", 1.0, ATTN_NORM );
m_iJuice = gSkillData.healthchargerCapacity;
m_iJuice = (int)gSkillData.healthchargerCapacity;
pev->frame = 0;
SetThink( &CBaseEntity::SUB_DoNothing );
}
@ -243,7 +243,7 @@ void CWallHealth::Off( void ) @@ -243,7 +243,7 @@ void CWallHealth::Off( void )
m_iOn = 0;
if( ( !m_iJuice ) && ( ( m_iReactivate = g_pGameRules->FlHealthChargerRechargeTime() ) > 0 ) )
if( ( !m_iJuice ) && ( ( m_iReactivate = (int)g_pGameRules->FlHealthChargerRechargeTime() ) > 0 ) )
{
pev->nextthink = pev->ltime + m_iReactivate;
SetThink( &CWallHealth::Recharge );

26
dlls/hgrunt.cpp

@ -217,7 +217,7 @@ const char *CHGrunt::pGruntSentences[] = @@ -217,7 +217,7 @@ const char *CHGrunt::pGruntSentences[] =
"HG_TAUNT", // say rude things
};
enum
typedef enum
{
HGRUNT_SENT_NONE = -1,
HGRUNT_SENT_GREN = 0,
@ -366,7 +366,7 @@ void CHGrunt::JustSpoke( void ) @@ -366,7 +366,7 @@ void CHGrunt::JustSpoke( void )
//=========================================================
void CHGrunt::PrescheduleThink( void )
{
if( InSquad() && m_hEnemy != NULL )
if( InSquad() && m_hEnemy != 0 )
{
if( HasConditions( bits_COND_SEE_ENEMY ) )
{
@ -413,9 +413,9 @@ BOOL CHGrunt::FCanCheckAttacks( void ) @@ -413,9 +413,9 @@ BOOL CHGrunt::FCanCheckAttacks( void )
//=========================================================
BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist )
{
CBaseMonster *pEnemy;
CBaseMonster *pEnemy = 0;
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
pEnemy = m_hEnemy->MyMonsterPointer();
@ -787,7 +787,7 @@ Vector CHGrunt::GetGunPosition() @@ -787,7 +787,7 @@ Vector CHGrunt::GetGunPosition()
//=========================================================
void CHGrunt::Shoot( void )
{
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
return;
}
@ -814,7 +814,7 @@ void CHGrunt::Shoot( void ) @@ -814,7 +814,7 @@ void CHGrunt::Shoot( void )
//=========================================================
void CHGrunt::Shotgun( void )
{
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
return;
}
@ -1834,7 +1834,7 @@ IMPLEMENT_CUSTOM_SCHEDULES( CHGrunt, CSquadMonster ) @@ -1834,7 +1834,7 @@ IMPLEMENT_CUSTOM_SCHEDULES( CHGrunt, CSquadMonster )
void CHGrunt::SetActivity( Activity NewActivity )
{
int iSequence = ACTIVITY_NOT_AVAILABLE;
void *pmodel = GET_MODEL_PTR( ENT( pev ) );
//void *pmodel = GET_MODEL_PTR( ENT( pev ) );
switch( NewActivity )
{
@ -2032,10 +2032,10 @@ Schedule_t *CHGrunt::GetSchedule( void ) @@ -2032,10 +2032,10 @@ Schedule_t *CHGrunt::GetSchedule( void )
// before he starts pluggin away.
if( FOkToSpeak() )// && RANDOM_LONG( 0, 1 ) )
{
if( ( m_hEnemy != NULL ) && m_hEnemy->IsPlayer() )
if( ( m_hEnemy != 0 ) && m_hEnemy->IsPlayer() )
// player
SENTENCEG_PlayRndSz( ENT( pev ), "HG_ALERT", HGRUNT_SENTENCE_VOLUME, GRUNT_ATTN, 0, m_voicePitch );
else if( ( m_hEnemy != NULL ) &&
else if( ( m_hEnemy != 0 ) &&
( m_hEnemy->Classify() != CLASS_PLAYER_ALLY ) &&
( m_hEnemy->Classify() != CLASS_HUMAN_PASSIVE ) &&
( m_hEnemy->Classify() != CLASS_MACHINE ) )
@ -2072,7 +2072,7 @@ Schedule_t *CHGrunt::GetSchedule( void ) @@ -2072,7 +2072,7 @@ Schedule_t *CHGrunt::GetSchedule( void )
// 10% chance of flinch.
int iPercent = RANDOM_LONG( 0, 99 );
if( iPercent <= 90 && m_hEnemy != NULL )
if( iPercent <= 90 && m_hEnemy != 0 )
{
// only try to take cover if we actually have an enemy!
@ -2308,7 +2308,7 @@ Schedule_t *CHGrunt::GetScheduleOfType( int Type ) @@ -2308,7 +2308,7 @@ Schedule_t *CHGrunt::GetScheduleOfType( int Type )
}
case SCHED_FAIL:
{
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
// grunt has an enemy, so pick a different default fail schedule most likely to help recover.
return &slGruntCombatFail[0];
@ -2408,10 +2408,10 @@ public: @@ -2408,10 +2408,10 @@ public:
void KeyValue( KeyValueData *pkvd );
int m_iPose;// which sequence to display -- temporary, don't need to save
static char *m_szPoses[3];
static const char *m_szPoses[3];
};
char *CDeadHGrunt::m_szPoses[] = { "deadstomach", "deadside", "deadsitting" };
const char *CDeadHGrunt::m_szPoses[] = { "deadstomach", "deadside", "deadsitting" };
void CDeadHGrunt::KeyValue( KeyValueData *pkvd )
{

6
dlls/hornet.cpp

@ -258,14 +258,14 @@ void CHornet::TrackTarget( void ) @@ -258,14 +258,14 @@ void CHornet::TrackTarget( void )
}
// UNDONE: The player pointer should come back after returning from another level
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
// enemy is dead.
Look( 512 );
m_hEnemy = BestVisibleEnemy();
}
if( m_hEnemy != NULL && FVisible( m_hEnemy ) )
if( m_hEnemy != 0 && FVisible( m_hEnemy ) )
{
m_vecEnemyLKP = m_hEnemy->BodyTarget( pev->origin );
}
@ -335,7 +335,7 @@ void CHornet::TrackTarget( void ) @@ -335,7 +335,7 @@ void CHornet::TrackTarget( void )
// if hornet is close to the enemy, jet in a straight line for a half second.
// (only in the single player game)
if( m_hEnemy != NULL && !g_pGameRules->IsMultiplayer() )
if( m_hEnemy != 0 && !g_pGameRules->IsMultiplayer() )
{
if( flDelta >= 0.4 && ( pev->origin - m_vecEnemyLKP ).Length() <= 300 )
{

2
dlls/houndeye.cpp

@ -137,7 +137,7 @@ int CHoundeye::Classify( void ) @@ -137,7 +137,7 @@ int CHoundeye::Classify( void )
//=========================================================
BOOL CHoundeye::FValidateHintType( short sHint )
{
int i;
size_t i;
static short sHoundHints[] =
{

8
dlls/ichthyosaur.cpp

@ -416,7 +416,7 @@ void CIchthyosaur::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -416,7 +416,7 @@ void CIchthyosaur::HandleAnimEvent( MonsterEvent_t *pEvent )
case ICHTHYOSAUR_AE_SHAKE_RIGHT:
case ICHTHYOSAUR_AE_SHAKE_LEFT:
{
if( m_hEnemy != NULL && FVisible( m_hEnemy ) )
if( m_hEnemy != 0 && FVisible( m_hEnemy ) )
{
CBaseEntity *pHurt = m_hEnemy;
@ -622,7 +622,7 @@ void CIchthyosaur::RunTask( Task_t *pTask ) @@ -622,7 +622,7 @@ void CIchthyosaur::RunTask( Task_t *pTask )
switch( pTask->iTask )
{
case TASK_ICHTHYOSAUR_CIRCLE_ENEMY:
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
TaskComplete();
}
@ -864,7 +864,7 @@ void CIchthyosaur::Stop( void ) @@ -864,7 +864,7 @@ void CIchthyosaur::Stop( void )
void CIchthyosaur::Swim()
{
int retValue = 0;
//int retValue = 0;
Vector start = pev->origin;
@ -1072,7 +1072,7 @@ Vector CIchthyosaur::DoProbe( const Vector &Probe ) @@ -1072,7 +1072,7 @@ Vector CIchthyosaur::DoProbe( const Vector &Probe )
}
}
if( bBumpedSomething && ( m_hEnemy == NULL || tr.pHit != m_hEnemy->edict() ) )
if( bBumpedSomething && ( m_hEnemy == 0 || tr.pHit != m_hEnemy->edict() ) )
{
Vector ProbeDir = Probe - pev->origin;

20
dlls/islave.cpp

@ -51,7 +51,7 @@ public: @@ -51,7 +51,7 @@ public:
void HandleAnimEvent( MonsterEvent_t *pEvent );
BOOL CheckRangeAttack1( float flDot, float flDist );
BOOL CheckRangeAttack2( float flDot, float flDist );
void CallForHelp( char *szClassname, float flDist, EHANDLE hEnemy, Vector &vecLocation );
void CallForHelp( const char *szClassname, float flDist, EHANDLE hEnemy, Vector &vecLocation );
void TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType );
int TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType );
@ -155,7 +155,7 @@ int CISlave::IRelationship( CBaseEntity *pTarget ) @@ -155,7 +155,7 @@ int CISlave::IRelationship( CBaseEntity *pTarget )
return CBaseMonster::IRelationship( pTarget );
}
void CISlave::CallForHelp( char *szClassname, float flDist, EHANDLE hEnemy, Vector &vecLocation )
void CISlave::CallForHelp( const char *szClassname, float flDist, EHANDLE hEnemy, Vector &vecLocation )
{
// ALERT( at_aiconsole, "help " );
@ -185,7 +185,7 @@ void CISlave::CallForHelp( char *szClassname, float flDist, EHANDLE hEnemy, Vect @@ -185,7 +185,7 @@ void CISlave::CallForHelp( char *szClassname, float flDist, EHANDLE hEnemy, Vect
//=========================================================
void CISlave::AlertSound( void )
{
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
SENTENCEG_PlayRndSz( ENT( pev ), "SLV_ALERT", 0.85, ATTN_NORM, 0, m_voicePitch );
@ -365,7 +365,7 @@ void CISlave::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -365,7 +365,7 @@ void CISlave::HandleAnimEvent( MonsterEvent_t *pEvent )
WRITE_BYTE( 0 ); // decay * 0.1
MESSAGE_END();
}
if( m_hDead != NULL )
if( m_hDead != 0 )
{
WackBeam( -1, m_hDead );
WackBeam( 1, m_hDead );
@ -385,7 +385,7 @@ void CISlave::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -385,7 +385,7 @@ void CISlave::HandleAnimEvent( MonsterEvent_t *pEvent )
{
ClearBeams();
if( m_hDead != NULL )
if( m_hDead != 0 )
{
Vector vecDest = m_hDead->pev->origin + Vector( 0, 0, 38 );
TraceResult trace;
@ -394,7 +394,7 @@ void CISlave::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -394,7 +394,7 @@ void CISlave::HandleAnimEvent( MonsterEvent_t *pEvent )
if( !trace.fStartSolid )
{
CBaseEntity *pNew = Create( "monster_alien_slave", m_hDead->pev->origin, m_hDead->pev->angles );
CBaseMonster *pNewMonster = pNew->MyMonsterPointer( );
//CBaseMonster *pNewMonster = pNew->MyMonsterPointer();
pNew->pev->spawnflags |= 1;
WackBeam( -1, pNew );
WackBeam( 1, pNew );
@ -484,7 +484,7 @@ BOOL CISlave::CheckRangeAttack2( float flDot, float flDist ) @@ -484,7 +484,7 @@ BOOL CISlave::CheckRangeAttack2( float flDot, float flDist )
}
}
}
if( m_hDead != NULL )
if( m_hDead != 0 )
return TRUE;
else
return FALSE;
@ -530,7 +530,7 @@ void CISlave::Spawn() @@ -530,7 +530,7 @@ void CISlave::Spawn()
//=========================================================
void CISlave::Precache()
{
int i;
size_t i;
PRECACHE_MODEL( "models/islave.mdl" );
PRECACHE_MODEL( "sprites/lgtning.spr" );
@ -756,8 +756,8 @@ void CISlave::BeamGlow() @@ -756,8 +756,8 @@ void CISlave::BeamGlow()
//=========================================================
void CISlave::WackBeam( int side, CBaseEntity *pEntity )
{
Vector vecDest;
float flDist = 1.0;
//Vector vecDest;
//float flDist = 1.0;
if( m_iBeams >= ISLAVE_MAX_BEAMS )
return;

2
dlls/leech.cpp

@ -271,7 +271,7 @@ void CLeech::AlertSound( void ) @@ -271,7 +271,7 @@ void CLeech::AlertSound( void )
void CLeech::Precache( void )
{
int i;
size_t i;
//PRECACHE_MODEL( "models/icky.mdl" );
PRECACHE_MODEL( "models/leech.mdl" );

17
dlls/lights.cpp

@ -99,7 +99,7 @@ void CLight::Spawn( void ) @@ -99,7 +99,7 @@ void CLight::Spawn( void )
if( FBitSet( pev->spawnflags, SF_LIGHT_START_OFF ) )
LIGHT_STYLE( m_iStyle, "a" );
else if( m_iszPattern )
LIGHT_STYLE( m_iStyle, (char *)STRING( m_iszPattern ) );
LIGHT_STYLE( m_iStyle, STRING( m_iszPattern ) );
else
LIGHT_STYLE( m_iStyle, "m" );
}
@ -115,7 +115,7 @@ void CLight::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTyp @@ -115,7 +115,7 @@ void CLight::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTyp
if( FBitSet( pev->spawnflags, SF_LIGHT_START_OFF ) )
{
if( m_iszPattern )
LIGHT_STYLE( m_iStyle, (char *)STRING( m_iszPattern ) );
LIGHT_STYLE( m_iStyle, STRING( m_iszPattern ) );
else
LIGHT_STYLE( m_iStyle, "m" );
ClearBits( pev->spawnflags, SF_LIGHT_START_OFF );
@ -155,15 +155,16 @@ void CEnvLight::KeyValue( KeyValueData* pkvd ) @@ -155,15 +155,16 @@ void CEnvLight::KeyValue( KeyValueData* pkvd )
}
else if( j == 4 )
{
r = r * ( v / 255.0 );
g = g * ( v / 255.0 );
b = b * ( v / 255.0 );
v /= 255;
r *= v;
g *= v;
b *= v;
}
// simulate qrad direct, ambient,and gamma adjustments, as well as engine scaling
r = pow( r / 114.0, 0.6 ) * 264;
g = pow( g / 114.0, 0.6 ) * 264;
b = pow( b / 114.0, 0.6 ) * 264;
r = (int)( pow( r / 114.0, 0.6 ) * 264.0 );
g = (int)( pow( g / 114.0, 0.6 ) * 264.0 );
b = (int)( pow( b / 114.0, 0.6 ) * 264.0 );
pkvd->fHandled = TRUE;
sprintf( szColor, "%d", r );

6
dlls/maprules.cpp

@ -135,7 +135,7 @@ public: @@ -135,7 +135,7 @@ public:
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
void KeyValue( KeyValueData *pkvd );
inline int Points( void ) { return pev->frags; }
inline int Points( void ) { return (int)pev->frags; }
inline BOOL AllowNegativeScore( void ) { return pev->spawnflags & SF_SCORE_NEGATIVE; }
inline BOOL AwardToTeam( void ) { return pev->spawnflags & SF_SCORE_TEAM; }
@ -643,8 +643,8 @@ public: @@ -643,8 +643,8 @@ public:
inline void CountUp( void ) { pev->frags++; }
inline void CountDown( void ) { pev->frags--; }
inline void ResetCount( void ) { pev->frags = pev->dmg; }
inline int CountValue( void ) { return pev->frags; }
inline int LimitValue( void ) { return pev->health; }
inline int CountValue( void ) { return (int)pev->frags; }
inline int LimitValue( void ) { return (int)pev->health; }
inline BOOL HitLimit( void ) { return CountValue() == LimitValue(); }

22
dlls/monsters.cpp

@ -133,7 +133,7 @@ int CBaseMonster::Restore( CRestore &restore ) @@ -133,7 +133,7 @@ int CBaseMonster::Restore( CRestore &restore )
m_Activity = ACT_RESET;
// If we don't have an enemy, clear conditions like see enemy, etc.
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
m_afConditions = 0;
return status;
@ -672,7 +672,7 @@ BOOL CBaseMonster::FRefreshRoute( void ) @@ -672,7 +672,7 @@ BOOL CBaseMonster::FRefreshRoute( void )
returnCode = BuildRoute( m_vecMoveGoal, bits_MF_TO_LOCATION, NULL );
break;
case MOVEGOAL_TARGETENT:
if( m_hTargetEnt != NULL )
if( m_hTargetEnt != 0 )
{
returnCode = BuildRoute( m_hTargetEnt->pev->origin, bits_MF_TO_TARGETENT, m_hTargetEnt );
}
@ -954,7 +954,7 @@ BOOL CBaseMonster::CheckRangeAttack2( float flDot, float flDist ) @@ -954,7 +954,7 @@ BOOL CBaseMonster::CheckRangeAttack2( float flDot, float flDist )
BOOL CBaseMonster::CheckMeleeAttack1( float flDot, float flDist )
{
// Decent fix to keep folks from kicking/punching hornets and snarks is to check the onground flag(sjb)
if( flDist <= 64 && flDot >= 0.7 && m_hEnemy != NULL && FBitSet( m_hEnemy->pev->flags, FL_ONGROUND ) )
if( flDist <= 64 && flDot >= 0.7 && m_hEnemy != 0 && FBitSet( m_hEnemy->pev->flags, FL_ONGROUND ) )
{
return TRUE;
}
@ -1165,7 +1165,7 @@ void CBaseMonster::PushEnemy( CBaseEntity *pEnemy, Vector &vecLastKnownPos ) @@ -1165,7 +1165,7 @@ void CBaseMonster::PushEnemy( CBaseEntity *pEnemy, Vector &vecLastKnownPos )
{
if( m_hOldEnemy[i] == pEnemy )
return;
if( m_hOldEnemy[i] == NULL ) // someone died, reuse their slot
if( m_hOldEnemy[i] == 0 ) // someone died, reuse their slot
break;
}
if( i >= MAX_OLD_ENEMIES )
@ -1183,7 +1183,7 @@ BOOL CBaseMonster::PopEnemy() @@ -1183,7 +1183,7 @@ BOOL CBaseMonster::PopEnemy()
// UNDONE: blah, this is bad, we should use a stack but I'm too lazy to code one.
for( int i = MAX_OLD_ENEMIES - 1; i >= 0; i-- )
{
if( m_hOldEnemy[i] != NULL )
if( m_hOldEnemy[i] != 0 )
{
if( m_hOldEnemy[i]->IsAlive()) // cheat and know when they die
{
@ -1240,7 +1240,7 @@ void CBaseMonster::SetActivity( Activity NewActivity ) @@ -1240,7 +1240,7 @@ void CBaseMonster::SetActivity( Activity NewActivity )
//=========================================================
// SetSequenceByName
//=========================================================
void CBaseMonster::SetSequenceByName( char *szSequence )
void CBaseMonster::SetSequenceByName( const char *szSequence )
{
int iSequence;
@ -2863,7 +2863,7 @@ void CBaseMonster::ReportAIState( void ) @@ -2863,7 +2863,7 @@ void CBaseMonster::ReportAIState( void )
else
ALERT( level, "No Schedule, " );
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
ALERT( level, "\nEnemy is %s", STRING( m_hEnemy->pev->classname ) );
else
ALERT( level, "No enemy" );
@ -2950,7 +2950,7 @@ BOOL CBaseMonster::FCheckAITrigger( void ) @@ -2950,7 +2950,7 @@ BOOL CBaseMonster::FCheckAITrigger( void )
switch( m_iTriggerCondition )
{
case AITRIGGER_SEEPLAYER_ANGRY_AT_PLAYER:
if( m_hEnemy != NULL && m_hEnemy->IsPlayer() && HasConditions( bits_COND_SEE_ENEMY ) )
if( m_hEnemy != 0 && m_hEnemy->IsPlayer() && HasConditions( bits_COND_SEE_ENEMY ) )
{
fFireTarget = TRUE;
}
@ -3321,7 +3321,7 @@ BOOL CBaseMonster::GetEnemy( void ) @@ -3321,7 +3321,7 @@ BOOL CBaseMonster::GetEnemy( void )
}
// remember old enemies
if( m_hEnemy == NULL && PopEnemy() )
if( m_hEnemy == 0 && PopEnemy() )
{
if( m_pSchedule )
{
@ -3332,7 +3332,7 @@ BOOL CBaseMonster::GetEnemy( void ) @@ -3332,7 +3332,7 @@ BOOL CBaseMonster::GetEnemy( void )
}
}
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
// monster has an enemy.
return TRUE;
@ -3344,7 +3344,7 @@ BOOL CBaseMonster::GetEnemy( void ) @@ -3344,7 +3344,7 @@ BOOL CBaseMonster::GetEnemy( void )
//=========================================================
// DropItem - dead monster drops named item
//=========================================================
CBaseEntity *CBaseMonster::DropItem( char *pszItemName, const Vector &vecPos, const Vector &vecAng )
CBaseEntity *CBaseMonster::DropItem( const char *pszItemName, const Vector &vecPos, const Vector &vecAng )
{
if( !pszItemName )
{

6
dlls/monsterstate.cpp

@ -42,7 +42,7 @@ void CBaseMonster::SetState( MONSTERSTATE State ) @@ -42,7 +42,7 @@ void CBaseMonster::SetState( MONSTERSTATE State )
// Drop enemy pointers when going to idle
case MONSTERSTATE_IDLE:
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
m_hEnemy = NULL;// not allowed to have an enemy anymore.
ALERT( at_aiconsole, "Stripped\n" );
@ -92,7 +92,7 @@ void CBaseMonster::RunAI( void ) @@ -92,7 +92,7 @@ void CBaseMonster::RunAI( void )
}
// do these calculations if monster has an enemy.
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
CheckEnemy( m_hEnemy );
}
@ -198,7 +198,7 @@ MONSTERSTATE CBaseMonster::GetIdealState( void ) @@ -198,7 +198,7 @@ MONSTERSTATE CBaseMonster::GetIdealState( void )
COMBAT goes to ALERT upon death of enemy
*/
{
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
m_IdealMonsterState = MONSTERSTATE_ALERT;
// pev->effects = EF_BRIGHTFIELD;

4
dlls/mpstubb.cpp

@ -230,7 +230,7 @@ CBaseEntity *CBaseMonster::BestVisibleEnemy( void ) @@ -230,7 +230,7 @@ CBaseEntity *CBaseMonster::BestVisibleEnemy( void )
// currently think is the best visible enemy. No need to do
// a distance check, just get mad at this one for now.
iBestRelationship = IRelationship( pNextEnt );
iNearest = ( pNextEnt->pev->origin - pev->origin ).Length();
(int)iNearest = ( pNextEnt->pev->origin - pev->origin ).Length();
pReturn = pNextEnt;
}
else if( IRelationship( pNextEnt ) == iBestRelationship )
@ -238,7 +238,7 @@ CBaseEntity *CBaseMonster::BestVisibleEnemy( void ) @@ -238,7 +238,7 @@ CBaseEntity *CBaseMonster::BestVisibleEnemy( void )
// this entity is disliked just as much as the entity that
// we currently think is the best visible enemy, so we only
// get mad at it if it is closer.
iDist = ( pNextEnt->pev->origin - pev->origin ).Length();
(int)iDist = ( pNextEnt->pev->origin - pev->origin ).Length();
if( iDist <= iNearest )
{

16
dlls/multiplay_gamerules.cpp

@ -256,7 +256,7 @@ void CHalfLifeMultiplay::Think( void ) @@ -256,7 +256,7 @@ void CHalfLifeMultiplay::Think( void )
if( pPlayer )
{
remain = flFragLimit - pPlayer->pev->frags;
remain = (int)( flFragLimit - pPlayer->pev->frags );
if( remain < bestfrags )
{
bestfrags = remain;
@ -300,7 +300,7 @@ BOOL CHalfLifeMultiplay::IsDeathmatch( void ) @@ -300,7 +300,7 @@ BOOL CHalfLifeMultiplay::IsDeathmatch( void )
//=========================================================
BOOL CHalfLifeMultiplay::IsCoOp( void )
{
return gpGlobals->coop;
return gpGlobals->coop ? TRUE : FALSE;
}
//=========================================================
@ -467,7 +467,7 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl ) @@ -467,7 +467,7 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl )
{
MESSAGE_BEGIN( MSG_ONE, gmsgScoreInfo, NULL, pl->edict() );
WRITE_BYTE( i ); // client number
WRITE_SHORT( plr->pev->frags );
WRITE_SHORT( (int)plr->pev->frags );
WRITE_SHORT( plr->m_iDeaths );
WRITE_SHORT( 0 );
WRITE_SHORT( GetTeamIndex( plr->m_szTeamName ) + 1 );
@ -652,7 +652,7 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, @@ -652,7 +652,7 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller,
// killed scores
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
WRITE_BYTE( ENTINDEX(pVictim->edict()) );
WRITE_SHORT( pVictim->pev->frags );
WRITE_SHORT( (int)pVictim->pev->frags );
WRITE_SHORT( pVictim->m_iDeaths );
WRITE_SHORT( 0 );
WRITE_SHORT( GetTeamIndex( pVictim->m_szTeamName ) + 1 );
@ -666,7 +666,7 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, @@ -666,7 +666,7 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller,
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
WRITE_BYTE( ENTINDEX( PK->edict() ) );
WRITE_SHORT( PK->pev->frags );
WRITE_SHORT( (int)PK->pev->frags );
WRITE_SHORT( PK->m_iDeaths );
WRITE_SHORT( 0 );
WRITE_SHORT( GetTeamIndex( PK->m_szTeamName ) + 1 );
@ -689,14 +689,14 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, @@ -689,14 +689,14 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller,
void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor )
{
// Work out what killed the player, and send a message to all clients about it
CBaseEntity *Killer = CBaseEntity::Instance( pKiller );
CBaseEntity::Instance( pKiller );
const char *killer_weapon_name = "world"; // by default, the player is killed by the world
int killer_index = 0;
// Hack to fix name change
char *tau = "tau_cannon";
char *gluon = "gluon gun";
const char *tau = "tau_cannon";
const char *gluon = "gluon gun";
if( pKiller->flags & FL_CLIENT )
{

44
dlls/nihilanth.cpp

@ -587,7 +587,7 @@ void CNihilanth::ShootBalls( void ) @@ -587,7 +587,7 @@ void CNihilanth::ShootBalls( void )
while( m_flShootTime < m_flShootEnd && m_flShootTime < gpGlobals->time )
{
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
Vector vecSrc, vecDir;
CNihilanthHVR *pEntity;
@ -742,7 +742,7 @@ void CNihilanth::NextActivity() @@ -742,7 +742,7 @@ void CNihilanth::NextActivity()
float flDist = ( m_posDesired - pev->origin ).Length();
float flDot = DotProduct( m_vecDesired, gpGlobals->v_forward );
if( m_hRecharger != NULL )
if( m_hRecharger != 0 )
{
// at we at power up yet?
if( flDist < 128.0 )
@ -767,23 +767,23 @@ void CNihilanth::NextActivity() @@ -767,23 +767,23 @@ void CNihilanth::NextActivity()
return;
}
if( m_hEnemy != NULL && !m_hEnemy->IsAlive() )
if( m_hEnemy != 0 && !m_hEnemy->IsAlive() )
{
m_hEnemy = NULL;
m_hEnemy = 0;
}
if( m_flLastSeen + 15 < gpGlobals->time )
{
m_hEnemy = NULL;
m_hEnemy = 0;
}
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
Look( 4096 );
m_hEnemy = BestVisibleEnemy();
}
if( m_hEnemy != NULL && m_irritation != 0 )
if( m_hEnemy != 0 && m_irritation != 0 )
{
if( m_flLastSeen + 5 > gpGlobals->time && flDist < 256 && flDot > 0 )
{
@ -860,7 +860,7 @@ void CNihilanth::HuntThink( void ) @@ -860,7 +860,7 @@ void CNihilanth::HuntThink( void )
}
// look for current enemy
if( m_hEnemy != NULL && m_hRecharger == NULL )
if( m_hEnemy != 0 && m_hRecharger == NULL )
{
if( FVisible( m_hEnemy ) )
{
@ -928,7 +928,7 @@ void CNihilanth::Flight( void ) @@ -928,7 +928,7 @@ void CNihilanth::Flight( void )
if( flDir < 0 )
flSpeed = -flSpeed;
float flDist = DotProduct( m_posDesired - vecEst, gpGlobals->v_forward );
//float flDist = DotProduct( m_posDesired - vecEst, gpGlobals->v_forward );
// sideways drag
m_velocity.x = m_velocity.x * ( 1.0 - fabs( gpGlobals->v_right.x ) * 0.05 );
@ -959,7 +959,7 @@ BOOL CNihilanth::AbsorbSphere( void ) @@ -959,7 +959,7 @@ BOOL CNihilanth::AbsorbSphere( void )
{
for( int i = 0; i < N_SPHERES; i++ )
{
if( m_hSphere[i] != NULL )
if( m_hSphere[i] != 0 )
{
CNihilanthHVR *pSphere = (CNihilanthHVR *)( (CBaseEntity *)m_hSphere[i] );
pSphere->AbsorbInit();
@ -978,7 +978,7 @@ BOOL CNihilanth::EmitSphere( void ) @@ -978,7 +978,7 @@ BOOL CNihilanth::EmitSphere( void )
for( int i = 0; i < N_SPHERES; i++ )
{
if( m_hSphere[i] != NULL )
if( m_hSphere[i] != 0 )
{
m_iActiveSpheres++;
}
@ -1007,10 +1007,10 @@ void CNihilanth::TargetSphere( USE_TYPE useType, float value ) @@ -1007,10 +1007,10 @@ void CNihilanth::TargetSphere( USE_TYPE useType, float value )
for( i = 0; i < N_SPHERES; i++ )
{
if( m_hSphere[i] != NULL )
if( m_hSphere[i] != 0 )
{
pSphere = m_hSphere[i]->MyMonsterPointer();
if( pSphere->m_hEnemy == NULL )
if( pSphere->m_hEnemy == 0 )
break;
}
}
@ -1141,7 +1141,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -1141,7 +1141,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent )
case 4:
// get a sphere
{
if( m_hRecharger != NULL )
if( m_hRecharger != 0 )
{
if( !EmitSphere() )
{
@ -1340,7 +1340,7 @@ void CNihilanthHVR::HoverThink( void ) @@ -1340,7 +1340,7 @@ void CNihilanthHVR::HoverThink( void )
{
pev->nextthink = gpGlobals->time + 0.1;
if( m_hTargetEnt != NULL )
if( m_hTargetEnt != 0 )
{
CircleTarget( m_hTargetEnt->pev->origin + Vector( 0, 0, 16 * N_SCALE ) );
}
@ -1424,7 +1424,7 @@ void CNihilanthHVR::ZapThink( void ) @@ -1424,7 +1424,7 @@ void CNihilanthHVR::ZapThink( void )
pev->nextthink = gpGlobals->time + 0.05;
// check world boundaries
if( m_hEnemy == NULL || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 )
if( m_hEnemy == 0 || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 )
{
SetTouch( NULL );
UTIL_Remove( this );
@ -1561,7 +1561,7 @@ void CNihilanthHVR::TeleportThink( void ) @@ -1561,7 +1561,7 @@ void CNihilanthHVR::TeleportThink( void )
pev->nextthink = gpGlobals->time + 0.1;
// check world boundaries
if( m_hEnemy == NULL || !m_hEnemy->IsAlive() || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 )
if( m_hEnemy == 0 || !m_hEnemy->IsAlive() || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 )
{
STOP_SOUND( edict(), CHAN_WEAPON, "x/x_teleattack1.wav" );
UTIL_Remove( this );
@ -1573,10 +1573,10 @@ void CNihilanthHVR::TeleportThink( void ) @@ -1573,10 +1573,10 @@ void CNihilanthHVR::TeleportThink( void )
STOP_SOUND( edict(), CHAN_WEAPON, "x/x_teleattack1.wav" );
UTIL_Remove( this );
if( m_hTargetEnt != NULL )
if( m_hTargetEnt != 0 )
m_hTargetEnt->Use( m_hEnemy, m_hEnemy, USE_ON, 1.0 );
if( m_hTouch != NULL && m_hEnemy != NULL )
if( m_hTouch != 0 && m_hEnemy != NULL )
m_hTouch->Touch( m_hEnemy );
}
else
@ -1630,10 +1630,10 @@ void CNihilanthHVR::TeleportTouch( CBaseEntity *pOther ) @@ -1630,10 +1630,10 @@ void CNihilanthHVR::TeleportTouch( CBaseEntity *pOther )
if( pOther == pEnemy )
{
if( m_hTargetEnt != NULL )
if( m_hTargetEnt != 0 )
m_hTargetEnt->Use( pEnemy, pEnemy, USE_ON, 1.0 );
if( m_hTouch != NULL && pEnemy != NULL )
if( m_hTouch != 0 && pEnemy != NULL )
m_hTouch->Touch( pEnemy );
}
else
@ -1656,7 +1656,7 @@ void CNihilanthHVR::DissipateThink( void ) @@ -1656,7 +1656,7 @@ void CNihilanthHVR::DissipateThink( void )
pev->renderamt -= 2;
pev->scale += 0.1;
if( m_hTargetEnt != NULL )
if( m_hTargetEnt != 0 )
{
CircleTarget( m_hTargetEnt->pev->origin + Vector( 0, 0, 4096 ) );
}

19
dlls/nodes.cpp

@ -214,7 +214,7 @@ entvars_t *CGraph::LinkEntForLink( CLink *pLink, CNode *pNode ) @@ -214,7 +214,7 @@ entvars_t *CGraph::LinkEntForLink( CLink *pLink, CNode *pNode )
//=========================================================
int CGraph::HandleLinkEnt( int iNode, entvars_t *pevLinkEnt, int afCapMask, NODEQUERY queryType )
{
edict_t *pentWorld;
//edict_t *pentWorld;
CBaseEntity *pDoor;
TraceResult tr;
@ -230,7 +230,7 @@ int CGraph::HandleLinkEnt( int iNode, entvars_t *pevLinkEnt, int afCapMask, NODE @@ -230,7 +230,7 @@ int CGraph::HandleLinkEnt( int iNode, entvars_t *pevLinkEnt, int afCapMask, NODE
ALERT( at_aiconsole, "dead path ent!\n" );
return TRUE;
}
pentWorld = NULL;
//pentWorld = NULL;
// func_door
if( FClassnameIs( pevLinkEnt, "func_door" ) || FClassnameIs( pevLinkEnt, "func_door_rotating" ) )
@ -586,7 +586,7 @@ int CGraph::FindShortestPath( int *piPath, int iStart, int iDest, int iHull, int @@ -586,7 +586,7 @@ int CGraph::FindShortestPath( int *piPath, int iStart, int iDest, int iHull, int
int iVisitNode;
int iCurrentNode;
int iNumPathNodes;
int iHullMask;
int iHullMask = 0;
if( !m_fGraphPresent || !m_fGraphPointersSet )
{
@ -1665,10 +1665,10 @@ void CTestHull::BuildNodeGraph( void ) @@ -1665,10 +1665,10 @@ void CTestHull::BuildNodeGraph( void )
int iBadNode;// this is the node that caused graph generation to fail
int cMaxInitialLinks = 0;
int cMaxValidLinks = 0;
//int cMaxInitialLinks = 0;
//int cMaxValidLinks = 0;
int iPoolIndex = 0;
//int iPoolIndex = 0;
int cPoolLinks;// number of links in the pool.
Vector vecDirToCheckNode;
@ -2058,11 +2058,16 @@ void CTestHull::BuildNodeGraph( void ) @@ -2058,11 +2058,16 @@ void CTestHull::BuildNodeGraph( void )
fprintf( file, "\nAll Connections are Paired!\n" );
}
#ifdef _MSC_VER
#define SIZET_FMT "%Iu"
#else
#define SIZET_FMT "%zu"
#endif
fprintf( file, "-------------------------------------------------------------------------------\n" );
fprintf( file, "\n\n-------------------------------------------------------------------------------\n" );
fprintf( file, "Total Number of Connections in Pool: %d\n", cPoolLinks );
fprintf( file, "-------------------------------------------------------------------------------\n" );
fprintf( file, "Connection Pool: %d bytes\n", sizeof(CLink) * cPoolLinks );
fprintf( file, "Connection Pool: " SIZET_FMT " bytes\n", sizeof(CLink) * cPoolLinks );
fprintf( file, "-------------------------------------------------------------------------------\n" );
ALERT( at_aiconsole, "%d Nodes, %d Connections\n", WorldGraph.m_cNodes, cPoolLinks );

4
dlls/nodes.h

@ -15,7 +15,8 @@ @@ -15,7 +15,8 @@
//=========================================================
// nodes.h
//=========================================================
#ifndef NODES_H
#define NODES_H
//=========================================================
// DEFINE
//=========================================================
@ -370,3 +371,4 @@ enum @@ -370,3 +371,4 @@ enum
};
extern CGraph WorldGraph;
#endif // NODES_H

18
dlls/observer.cpp

@ -35,7 +35,7 @@ void CBasePlayer::Observer_FindNextPlayer( bool bReverse ) @@ -35,7 +35,7 @@ void CBasePlayer::Observer_FindNextPlayer( bool bReverse )
else
iStart = ENTINDEX( edict() );
int iCurrent = iStart;
m_hObserverTarget = NULL;
m_hObserverTarget = 0;
int iDir = bReverse ? -1 : 1;
do
@ -125,11 +125,11 @@ void CBasePlayer::Observer_CheckTarget() @@ -125,11 +125,11 @@ void CBasePlayer::Observer_CheckTarget()
return;
// try to find a traget if we have no current one
if( m_hObserverTarget == NULL )
if( m_hObserverTarget == 0 )
{
Observer_FindNextPlayer( false );
if( m_hObserverTarget == NULL )
if( m_hObserverTarget == 0 )
{
// no target found at all
@ -166,7 +166,7 @@ void CBasePlayer::Observer_CheckTarget() @@ -166,7 +166,7 @@ void CBasePlayer::Observer_CheckTarget()
void CBasePlayer::Observer_CheckProperties()
{
// try to find a traget if we have no current one
if( pev->iuser1 == OBS_IN_EYE && m_hObserverTarget != NULL )
if( pev->iuser1 == OBS_IN_EYE && m_hObserverTarget != 0 )
{
CBasePlayer* target = (CBasePlayer*)( UTIL_PlayerByIndex( ENTINDEX( m_hObserverTarget->edict() ) ) );
@ -222,26 +222,26 @@ void CBasePlayer::Observer_SetMode( int iMode ) @@ -222,26 +222,26 @@ void CBasePlayer::Observer_SetMode( int iMode )
if( iMode < OBS_CHASE_LOCKED || iMode > OBS_MAP_CHASE )
iMode = OBS_IN_EYE; // now it is
// verify observer target again
if( m_hObserverTarget != NULL )
if( m_hObserverTarget != 0 )
{
CBaseEntity *pEnt = m_hObserverTarget;
if( ( pEnt == this ) || ( pEnt == NULL ) )
m_hObserverTarget = NULL;
m_hObserverTarget = 0;
else if( ( (CBasePlayer*)pEnt )->IsObserver() || ( pEnt->pev->effects & EF_NODRAW ) )
m_hObserverTarget = NULL;
m_hObserverTarget = 0;
}
// set spectator mode
pev->iuser1 = iMode;
// if we are not roaming, we need a valid target to track
if( ( iMode != OBS_ROAMING ) && ( m_hObserverTarget == NULL ) )
if( ( iMode != OBS_ROAMING ) && ( m_hObserverTarget == 0 ) )
{
Observer_FindNextPlayer( false );
// if we didn't find a valid target switch to roaming
if( m_hObserverTarget == NULL )
if( m_hObserverTarget == 0 )
{
ClientPrint( pev, HUD_PRINTCENTER, "#Spec_NoTarget" );
pev->iuser1 = OBS_ROAMING;

8
dlls/osprey.cpp

@ -261,7 +261,7 @@ BOOL COsprey::HasDead() @@ -261,7 +261,7 @@ BOOL COsprey::HasDead()
{
for( int i = 0; i < m_iUnits; i++ )
{
if( m_hGrunt[i] == NULL || !m_hGrunt[i]->IsAlive() )
if( m_hGrunt[i] == 0 || !m_hGrunt[i]->IsAlive() )
{
return TRUE;
}
@ -285,9 +285,9 @@ CBaseMonster *COsprey::MakeGrunt( Vector vecSrc ) @@ -285,9 +285,9 @@ CBaseMonster *COsprey::MakeGrunt( Vector vecSrc )
for( int i = 0; i < m_iUnits; i++ )
{
if( m_hGrunt[i] == NULL || !m_hGrunt[i]->IsAlive() )
if( m_hGrunt[i] == 0 || !m_hGrunt[i]->IsAlive() )
{
if( m_hGrunt[i] != NULL && m_hGrunt[i]->pev->rendermode == kRenderNormal )
if( m_hGrunt[i] != 0 && m_hGrunt[i]->pev->rendermode == kRenderNormal )
{
m_hGrunt[i]->SUB_StartFadeOut();
}
@ -319,7 +319,7 @@ void COsprey::HoverThink( void ) @@ -319,7 +319,7 @@ void COsprey::HoverThink( void )
int i;
for( i = 0; i < 4; i++ )
{
if( m_hRepel[i] != NULL && m_hRepel[i]->pev->health > 0 && !( m_hRepel[i]->pev->flags & FL_ONGROUND ) )
if( m_hRepel[i] != 0 && m_hRepel[i]->pev->health > 0 && !( m_hRepel[i]->pev->flags & FL_ONGROUND ) )
{
break;
}

8
dlls/plats.cpp

@ -82,12 +82,12 @@ void CBasePlatTrain::KeyValue( KeyValueData *pkvd ) @@ -82,12 +82,12 @@ void CBasePlatTrain::KeyValue( KeyValueData *pkvd )
}
else if( FStrEq( pkvd->szKeyName, "movesnd" ) )
{
m_bMoveSnd = atof( pkvd->szValue );
m_bMoveSnd = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "stopsnd" ) )
{
m_bStopSnd = atof( pkvd->szValue );
m_bStopSnd = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else if( FStrEq( pkvd->szKeyName, "volume" ) )
@ -1437,7 +1437,7 @@ void CFuncTrackTrain::Spawn( void ) @@ -1437,7 +1437,7 @@ void CFuncTrackTrain::Spawn( void )
pev->speed = 0;
pev->velocity = g_vecZero;
pev->avelocity = g_vecZero;
pev->impulse = m_speed;
pev->impulse = (int)m_speed;
m_dir = 1;
@ -2212,7 +2212,7 @@ void CGunTarget::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us @@ -2212,7 +2212,7 @@ void CGunTarget::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us
{
pev->takedamage = DAMAGE_AIM;
m_hTargetEnt = GetNextTarget();
if( m_hTargetEnt == NULL )
if( m_hTargetEnt == 0 )
return;
pev->health = pev->max_health;
Next();

66
dlls/player.cpp

@ -459,7 +459,7 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl @@ -459,7 +459,7 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl
}
// keep track of amount of damage last sustained
m_lastDamageAmount = flDamage;
m_lastDamageAmount = (int)flDamage;
// Armor.
if( pev->armorvalue && !( bitsDamageType & ( DMG_FALL | DMG_DROWN ) ) )// armor doesn't protect against fall or drown damage!
@ -787,7 +787,7 @@ void CBasePlayer::RemoveAllItems( BOOL removeSuit ) @@ -787,7 +787,7 @@ void CBasePlayer::RemoveAllItems( BOOL removeSuit )
m_pLastItem = NULL;
if( m_pTank != NULL )
if( m_pTank != 0 )
{
m_pTank->Use( this, this, USE_OFF, 0 );
m_pTank = NULL;
@ -847,7 +847,7 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib ) @@ -847,7 +847,7 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib )
g_pGameRules->PlayerKilled( this, pevAttacker, g_pevLastInflictor );
if( m_pTank != NULL )
if( m_pTank != 0 )
{
m_pTank->Use( this, this, USE_OFF, 0 );
m_pTank = NULL;
@ -1172,7 +1172,7 @@ void CBasePlayer::WaterMove() @@ -1172,7 +1172,7 @@ void CBasePlayer::WaterMove()
// track drowning damage, give it back when
// player finally takes a breath
m_idrowndmg += pev->dmg;
m_idrowndmg += (int)pev->dmg;
}
}
else
@ -1393,7 +1393,7 @@ void CBasePlayer::StartObserver( Vector vecPosition, Vector vecViewAngle ) @@ -1393,7 +1393,7 @@ void CBasePlayer::StartObserver( Vector vecPosition, Vector vecViewAngle )
if( m_pActiveItem )
m_pActiveItem->Holster();
if( m_pTank != NULL )
if( m_pTank != 0 )
{
m_pTank->Use( this, this, USE_OFF, 0 );
m_pTank = NULL;
@ -1468,7 +1468,7 @@ void CBasePlayer::PlayerUse( void ) @@ -1468,7 +1468,7 @@ void CBasePlayer::PlayerUse( void )
// Hit Use on a train?
if( m_afButtonPressed & IN_USE )
{
if( m_pTank != NULL )
if( m_pTank != 0 )
{
// Stop controlling the tank
// TODO: Send HUD Update
@ -1491,7 +1491,7 @@ void CBasePlayer::PlayerUse( void ) @@ -1491,7 +1491,7 @@ void CBasePlayer::PlayerUse( void )
if( pTrain && !( pev->button & IN_JUMP ) && FBitSet( pev->flags, FL_ONGROUND ) && (pTrain->ObjectCaps() & FCAP_DIRECTIONAL_USE ) && pTrain->OnControls( pev ) )
{
m_afPhysicsFlags |= PFLAG_ONTRAIN;
m_iTrain = TrainSpeed( pTrain->pev->speed, pTrain->pev->impulse );
m_iTrain = TrainSpeed( (int)pTrain->pev->speed, pTrain->pev->impulse );
m_iTrain |= TRAIN_NEW;
EMIT_SOUND( ENT( pev ), CHAN_ITEM, "plats/train_use1.wav", 0.8, ATTN_NORM );
return;
@ -1662,7 +1662,7 @@ void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore ) @@ -1662,7 +1662,7 @@ void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore )
if( -score > pev->frags ) // Will this go negative?
{
score = -pev->frags; // Sum will be 0
score = (int)( -pev->frags ); // Sum will be 0
}
}
}
@ -1671,7 +1671,7 @@ void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore ) @@ -1671,7 +1671,7 @@ void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore )
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
WRITE_BYTE( ENTINDEX( edict() ) );
WRITE_SHORT( pev->frags );
WRITE_SHORT( (int)pev->frags );
WRITE_SHORT( m_iDeaths );
WRITE_SHORT( 0 );
WRITE_SHORT( g_pGameRules->GetTeamIndex( m_szTeamName ) + 1 );
@ -1733,8 +1733,8 @@ void CBasePlayer::UpdateStatusBar() @@ -1733,8 +1733,8 @@ void CBasePlayer::UpdateStatusBar()
// allies and medics get to see the targets health
if( g_pGameRules->PlayerRelationship( this, pEntity ) == GR_TEAMMATE )
{
newSBarState[SBAR_ID_TARGETHEALTH] = 100 * ( pEntity->pev->health / pEntity->pev->max_health );
newSBarState[SBAR_ID_TARGETARMOR] = pEntity->pev->armorvalue; //No need to get it % based since 100 it's the max.
newSBarState[SBAR_ID_TARGETHEALTH] = (int)( 100 * ( pEntity->pev->health / pEntity->pev->max_health ) );
newSBarState[SBAR_ID_TARGETARMOR] = (int)pEntity->pev->armorvalue; //No need to get it % based since 100 it's the max.
}
m_flStatusBarDisappearDelay = gpGlobals->time + 1.0;
@ -1899,7 +1899,7 @@ void CBasePlayer::PreThink( void ) @@ -1899,7 +1899,7 @@ void CBasePlayer::PreThink( void )
if( vel )
{
m_iTrain = TrainSpeed( pTrain->pev->speed, pTrain->pev->impulse );
m_iTrain = TrainSpeed( (int)pTrain->pev->speed, pTrain->pev->impulse );
m_iTrain |= TRAIN_ACTIVE|TRAIN_NEW;
}
}
@ -2010,7 +2010,7 @@ void CBasePlayer::CheckTimeBasedDamage() @@ -2010,7 +2010,7 @@ void CBasePlayer::CheckTimeBasedDamage()
int i;
BYTE bDuration = 0;
static float gtbdPrev = 0.0;
//static float gtbdPrev = 0.0;
if( !( m_bitsDamageType & DMG_TIMEBASED ) )
return;
@ -2271,7 +2271,7 @@ void CBasePlayer::CheckSuitUpdate() @@ -2271,7 +2271,7 @@ void CBasePlayer::CheckSuitUpdate()
// seconds, then we won't repeat playback of this word or sentence
// for at least that number of seconds.
void CBasePlayer::SetSuitUpdate( char *name, int fgroup, int iNoRepeatTime )
void CBasePlayer::SetSuitUpdate( const char *name, int fgroup, int iNoRepeatTime )
{
int i;
int isentence;
@ -2399,7 +2399,7 @@ void CBasePlayer::UpdatePlayerSound( void ) @@ -2399,7 +2399,7 @@ void CBasePlayer::UpdatePlayerSound( void )
// is louder than his body/movement, use the weapon volume, else, use the body volume.
if( FBitSet( pev->flags, FL_ONGROUND ) )
{
iBodyVolume = pev->velocity.Length();
iBodyVolume = (int)pev->velocity.Length();
// clamp the noise that can be made by the body, in case a push trigger,
// weapon recoil, or anything shoves the player abnormally fast.
@ -2432,7 +2432,7 @@ void CBasePlayer::UpdatePlayerSound( void ) @@ -2432,7 +2432,7 @@ void CBasePlayer::UpdatePlayerSound( void )
}
// decay weapon volume over time so bits_SOUND_COMBAT stays set for a while
m_iWeaponVolume -= 250 * gpGlobals->frametime;
m_iWeaponVolume -= (int)( 250 * gpGlobals->frametime );
if( m_iWeaponVolume < 0 )
{
iVolume = 0;
@ -2450,7 +2450,7 @@ void CBasePlayer::UpdatePlayerSound( void ) @@ -2450,7 +2450,7 @@ void CBasePlayer::UpdatePlayerSound( void )
}
else if( iVolume > m_iTargetVolume )
{
iVolume -= 250 * gpGlobals->frametime;
iVolume -= (int)( 250 * gpGlobals->frametime );
if( iVolume < m_iTargetVolume )
{
@ -2479,7 +2479,7 @@ void CBasePlayer::UpdatePlayerSound( void ) @@ -2479,7 +2479,7 @@ void CBasePlayer::UpdatePlayerSound( void )
}
// keep track of virtual muzzle flash
m_iWeaponFlash -= 256 * gpGlobals->frametime;
m_iWeaponFlash -= (int)( 256 * gpGlobals->frametime );
if( m_iWeaponFlash < 0 )
m_iWeaponFlash = 0;
@ -2501,7 +2501,7 @@ void CBasePlayer::PostThink() @@ -2501,7 +2501,7 @@ void CBasePlayer::PostThink()
goto pt_end;
// Handle Tank controlling
if( m_pTank != NULL )
if( m_pTank != 0 )
{
// if they've moved too far from the gun, or selected a weapon, unuse the gun
if( m_pTank->OnControls( pev ) && !pev->weaponmodel )
@ -2565,7 +2565,7 @@ void CBasePlayer::PostThink() @@ -2565,7 +2565,7 @@ void CBasePlayer::PostThink()
{
if( m_flFallVelocity > 64 && !g_pGameRules->IsMultiplayer() )
{
CSoundEnt::InsertSound( bits_SOUND_PLAYER, pev->origin, m_flFallVelocity, 0.2 );
CSoundEnt::InsertSound( bits_SOUND_PLAYER, pev->origin, (int)m_flFallVelocity, 0.2 );
// ALERT( at_console, "fall %f\n", m_flFallVelocity );
}
m_flFallVelocity = 0;
@ -3195,7 +3195,7 @@ void CSprayCan::Think( void ) @@ -3195,7 +3195,7 @@ void CSprayCan::Think( void )
}
else
{
UTIL_PlayerDecalTrace( &tr, playernum, pev->frame, TRUE );
UTIL_PlayerDecalTrace( &tr, playernum, (int)pev->frame, TRUE );
// Just painted last custom frame.
if( pev->frame++ >= ( nFrames - 1 ) )
UTIL_Remove( this );
@ -3682,7 +3682,7 @@ int CBasePlayer::RemovePlayerItem( CBasePlayerItem *pItem ) @@ -3682,7 +3682,7 @@ int CBasePlayer::RemovePlayerItem( CBasePlayerItem *pItem )
//
// Returns the unique ID for the ammo, or -1 if error
//
int CBasePlayer::GiveAmmo( int iCount, char *szName, int iMax )
int CBasePlayer::GiveAmmo( int iCount, const char *szName, int iMax )
{
if( !szName )
{
@ -3756,10 +3756,10 @@ Called every frame by the player PostThink @@ -3756,10 +3756,10 @@ Called every frame by the player PostThink
*/
void CBasePlayer::ItemPostFrame()
{
static int fInSelect = FALSE;
//static int fInSelect = FALSE;
// check if the player is using a tank
if( m_pTank != NULL )
if( m_pTank != 0 )
return;
#if defined( CLIENT_WEAPONS )
@ -3912,12 +3912,12 @@ void CBasePlayer::UpdateClientData( void ) @@ -3912,12 +3912,12 @@ void CBasePlayer::UpdateClientData( void )
WRITE_BYTE( iHealth );
MESSAGE_END();
m_iClientHealth = pev->health;
m_iClientHealth = (int)pev->health;
}
if( pev->armorvalue != m_iClientBattery )
{
m_iClientBattery = pev->armorvalue;
m_iClientBattery = (int)pev->armorvalue;
ASSERT( gmsgBattery > 0 );
@ -3945,8 +3945,8 @@ void CBasePlayer::UpdateClientData( void ) @@ -3945,8 +3945,8 @@ void CBasePlayer::UpdateClientData( void )
int visibleDamageBits = m_bitsDamageType & DMG_SHOWNHUD;
MESSAGE_BEGIN( MSG_ONE, gmsgDamage, NULL, pev );
WRITE_BYTE( pev->dmg_save );
WRITE_BYTE( pev->dmg_take );
WRITE_BYTE( (int)pev->dmg_save );
WRITE_BYTE( (int)pev->dmg_take );
WRITE_LONG( visibleDamageBits );
WRITE_COORD( damageOrigin.x );
WRITE_COORD( damageOrigin.y );
@ -4211,8 +4211,8 @@ Vector CBasePlayer::GetAutoaimVector( float flDelta ) @@ -4211,8 +4211,8 @@ Vector CBasePlayer::GetAutoaimVector( float flDelta )
{
SET_CROSSHAIRANGLE( edict(), -m_vecAutoAim.x, m_vecAutoAim.y );
m_lastx = m_vecAutoAim.x;
m_lasty = m_vecAutoAim.y;
m_lastx = (int)m_vecAutoAim.x;
m_lasty = (int)m_vecAutoAim.y;
}
}
@ -4556,10 +4556,10 @@ public: @@ -4556,10 +4556,10 @@ public:
void KeyValue( KeyValueData *pkvd );
int m_iPose;// which sequence to display -- temporary, don't need to save
static char *m_szPoses[4];
static const char *m_szPoses[4];
};
char *CDeadHEV::m_szPoses[] =
const char *CDeadHEV::m_szPoses[] =
{
"deadback",
"deadsitting",
@ -4701,7 +4701,7 @@ void CRevertSaved::KeyValue( KeyValueData *pkvd ) @@ -4701,7 +4701,7 @@ void CRevertSaved::KeyValue( KeyValueData *pkvd )
void CRevertSaved::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
UTIL_ScreenFadeAll( pev->rendercolor, Duration(), HoldTime(), pev->renderamt, FFADE_OUT );
UTIL_ScreenFadeAll( pev->rendercolor, Duration(), HoldTime(), (int)pev->renderamt, FFADE_OUT );
pev->nextthink = gpGlobals->time + MessageTime();
SetThink( &CRevertSaved::MessageThink );
}

4
dlls/player.h

@ -273,7 +273,7 @@ public: @@ -273,7 +273,7 @@ public:
void GiveNamedItem( const char *szName );
void EnableControl(BOOL fControl);
int GiveAmmo( int iAmount, char *szName, int iMax );
int GiveAmmo( int iAmount, const char *szName, int iMax );
void SendAmmoUpdate(void);
void WaterMove( void );
@ -281,7 +281,7 @@ public: @@ -281,7 +281,7 @@ public:
void PlayerUse( void );
void CheckSuitUpdate();
void SetSuitUpdate(char *name, int fgroup, int iNoRepeat);
void SetSuitUpdate( const char *name, int fgroup, int iNoRepeat );
void UpdateGeigerCounter( void );
void CheckTimeBasedDamage( void );

4
dlls/satchel.cpp

@ -92,7 +92,7 @@ void CSatchelCharge::Spawn( void ) @@ -92,7 +92,7 @@ void CSatchelCharge::Spawn( void )
void CSatchelCharge::SatchelSlide( CBaseEntity *pOther )
{
entvars_t *pevOther = pOther->pev;
//entvars_t *pevOther = pOther->pev;
// don't hit the guy that launched this grenade
if( pOther->edict() == pev->owner )
@ -377,11 +377,11 @@ void CSatchel::Throw( void ) @@ -377,11 +377,11 @@ void CSatchel::Throw( void )
{
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] )
{
#ifndef CLIENT_DLL
Vector vecSrc = m_pPlayer->pev->origin;
Vector vecThrow = gpGlobals->v_forward * 274 + m_pPlayer->pev->velocity;
#ifndef CLIENT_DLL
CBaseEntity *pSatchel = Create( "monster_satchel", vecSrc, Vector( 0, 0, 0 ), m_pPlayer->edict() );
pSatchel->pev->velocity = vecThrow;
pSatchel->pev->avelocity.y = 400;

11
dlls/saverestore.h

@ -23,7 +23,7 @@ class CSaveRestoreBuffer @@ -23,7 +23,7 @@ class CSaveRestoreBuffer
public:
CSaveRestoreBuffer( void );
CSaveRestoreBuffer( SAVERESTOREDATA *pdata );
~CSaveRestoreBuffer( void );
virtual ~CSaveRestoreBuffer( void );
int EntityIndex( entvars_t *pevLookup );
int EntityIndex( edict_t *pentLookup );
@ -41,6 +41,10 @@ protected: @@ -41,6 +41,10 @@ protected:
SAVERESTOREDATA *m_pdata;
void BufferRewind( int size );
unsigned int HashString( const char *pszToken );
private:
// effc++ rule 11
void operator = ( CSaveRestoreBuffer& );
CSaveRestoreBuffer( const CSaveRestoreBuffer& );
};
class CSave : public CSaveRestoreBuffer
@ -81,7 +85,7 @@ typedef struct @@ -81,7 +85,7 @@ typedef struct
class CRestore : public CSaveRestoreBuffer
{
public:
CRestore( SAVERESTOREDATA *pdata ) : CSaveRestoreBuffer( pdata ) { m_global = 0; m_precache = TRUE; }
CRestore( SAVERESTOREDATA *pdata ) : CSaveRestoreBuffer( pdata ), m_global(0), m_precache( TRUE ) { }
int ReadEntVars( const char *pname, entvars_t *pev ); // entvars_t
int ReadFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount );
int ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount, int startField, int size, char *pName, void *pData );
@ -160,6 +164,9 @@ private: @@ -160,6 +164,9 @@ private:
globalentity_t *Find( string_t globalname );
globalentity_t *m_pList;
int m_listCount;
// effc++ rule 11
void operator = ( CGlobalState& );
CGlobalState( const CGlobalState& );
};
extern CGlobalState gGlobalState;

22
dlls/schedule.cpp

@ -238,7 +238,7 @@ void CBaseMonster::MaintainSchedule( void ) @@ -238,7 +238,7 @@ void CBaseMonster::MaintainSchedule( void )
{
if( (m_afConditions && !HasConditions( bits_COND_SCHEDULE_DONE ) ) ||
( m_pSchedule && (m_pSchedule->iInterruptMask & bits_COND_SCHEDULE_DONE ) ) ||
( ( m_MonsterState == MONSTERSTATE_COMBAT ) && ( m_hEnemy == NULL ) ) )
( ( m_MonsterState == MONSTERSTATE_COMBAT ) && ( m_hEnemy == 0 ) ) )
{
GetIdealState();
}
@ -407,7 +407,7 @@ void CBaseMonster::RunTask( Task_t *pTask ) @@ -407,7 +407,7 @@ void CBaseMonster::RunTask( Task_t *pTask )
{
float distance;
if( m_hTargetEnt == NULL )
if( m_hTargetEnt == 0 )
TaskFail();
else
{
@ -675,7 +675,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -675,7 +675,7 @@ void CBaseMonster::StartTask( Task_t *pTask )
}
case TASK_FIND_NEAR_NODE_COVER_FROM_ENEMY:
{
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
TaskFail();
return;
@ -695,7 +695,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -695,7 +695,7 @@ void CBaseMonster::StartTask( Task_t *pTask )
}
case TASK_FIND_FAR_NODE_COVER_FROM_ENEMY:
{
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
TaskFail();
return;
@ -715,7 +715,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -715,7 +715,7 @@ void CBaseMonster::StartTask( Task_t *pTask )
}
case TASK_FIND_NODE_COVER_FROM_ENEMY:
{
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
TaskFail();
return;
@ -737,7 +737,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -737,7 +737,7 @@ void CBaseMonster::StartTask( Task_t *pTask )
{
entvars_t *pevCover;
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
// Find cover from self if no enemy available
pevCover = pev;
@ -821,7 +821,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -821,7 +821,7 @@ void CBaseMonster::StartTask( Task_t *pTask )
SetTurnActivity();
break;
case TASK_FACE_TARGET:
if( m_hTargetEnt != NULL )
if( m_hTargetEnt != 0 )
{
MakeIdealYaw( m_hTargetEnt->pev->origin );
SetTurnActivity();
@ -904,7 +904,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -904,7 +904,7 @@ void CBaseMonster::StartTask( Task_t *pTask )
TaskComplete();
else
{
if( m_hTargetEnt == NULL || !MoveToTarget( newActivity, 2 ) )
if( m_hTargetEnt == 0 || !MoveToTarget( newActivity, 2 ) )
{
TaskFail();
ALERT( at_aiconsole, "%s Failed to reach target!!!\n", STRING( pev->classname ) );
@ -1043,7 +1043,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -1043,7 +1043,7 @@ void CBaseMonster::StartTask( Task_t *pTask )
case TASK_GET_PATH_TO_TARGET:
{
RouteClear();
if( m_hTargetEnt != NULL && MoveToTarget( m_movementActivity, 1 ) )
if( m_hTargetEnt != 0 && MoveToTarget( m_movementActivity, 1 ) )
{
TaskComplete();
}
@ -1272,7 +1272,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -1272,7 +1272,7 @@ void CBaseMonster::StartTask( Task_t *pTask )
}
case TASK_PLANT_ON_SCRIPT:
{
if( m_hTargetEnt != NULL )
if( m_hTargetEnt != 0 )
{
pev->origin = m_hTargetEnt->pev->origin; // Plant on target
}
@ -1282,7 +1282,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -1282,7 +1282,7 @@ void CBaseMonster::StartTask( Task_t *pTask )
}
case TASK_FACE_SCRIPT:
{
if( m_hTargetEnt != NULL )
if( m_hTargetEnt != 0 )
{
pev->ideal_yaw = UTIL_AngleMod( m_hTargetEnt->pev->angles.y );
}

18
dlls/scientist.cpp

@ -434,7 +434,7 @@ void CScientist::Scream( void ) @@ -434,7 +434,7 @@ void CScientist::Scream( void )
Activity CScientist::GetStoppedActivity( void )
{
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
return ACT_EXCITED;
return CTalkMonster::GetStoppedActivity();
}
@ -510,7 +510,7 @@ void CScientist::RunTask( Task_t *pTask ) @@ -510,7 +510,7 @@ void CScientist::RunTask( Task_t *pTask )
if( RANDOM_LONG( 0, 63 ) < 8 )
Scream();
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
TaskFail();
}
@ -893,8 +893,8 @@ Schedule_t *CScientist::GetSchedule( void ) @@ -893,8 +893,8 @@ Schedule_t *CScientist::GetSchedule( void )
m_fearTime = gpGlobals->time;
else if( DisregardEnemy( pEnemy ) ) // After 15 seconds of being hidden, return to alert
{
m_hEnemy = NULL;
pEnemy = NULL;
m_hEnemy = 0;
pEnemy = 0;
}
}
@ -1021,12 +1021,12 @@ MONSTERSTATE CScientist::GetIdealState( void ) @@ -1021,12 +1021,12 @@ MONSTERSTATE CScientist::GetIdealState( void )
{
// Strip enemy when going to alert
m_IdealMonsterState = MONSTERSTATE_ALERT;
m_hEnemy = NULL;
m_hEnemy = 0;
return m_IdealMonsterState;
}
// Follow if only scared a little
if( m_hTargetEnt != NULL )
if( m_hTargetEnt != 0 )
{
m_IdealMonsterState = MONSTERSTATE_ALERT;
return m_IdealMonsterState;
@ -1050,7 +1050,7 @@ MONSTERSTATE CScientist::GetIdealState( void ) @@ -1050,7 +1050,7 @@ MONSTERSTATE CScientist::GetIdealState( void )
BOOL CScientist::CanHeal( void )
{
if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == NULL ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5 ) ) )
if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == 0 ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5 ) ) )
return FALSE;
return TRUE;
@ -1093,10 +1093,10 @@ public: @@ -1093,10 +1093,10 @@ public:
void KeyValue( KeyValueData *pkvd );
int m_iPose;// which sequence to display
static char *m_szPoses[7];
static const char *m_szPoses[7];
};
char *CDeadScientist::m_szPoses[] =
const char *CDeadScientist::m_szPoses[] =
{
"lying_on_back",
"lying_on_stomach",

4
dlls/scripted.cpp

@ -1068,7 +1068,7 @@ BOOL CScriptedSentence::AcceptableSpeaker( CBaseMonster *pMonster ) @@ -1068,7 +1068,7 @@ BOOL CScriptedSentence::AcceptableSpeaker( CBaseMonster *pMonster )
{
if( pev->spawnflags & SF_SENTENCE_FOLLOWERS )
{
if( pMonster->m_hTargetEnt == NULL || !FClassnameIs( pMonster->m_hTargetEnt->pev, "player" ) )
if( pMonster->m_hTargetEnt == 0 || !FClassnameIs( pMonster->m_hTargetEnt->pev, "player" ) )
return FALSE;
}
BOOL override;
@ -1124,7 +1124,7 @@ BOOL CScriptedSentence::StartSentence( CBaseMonster *pTarget ) @@ -1124,7 +1124,7 @@ BOOL CScriptedSentence::StartSentence( CBaseMonster *pTarget )
if( !pTarget )
{
ALERT( at_aiconsole, "Not Playing sentence %s\n", STRING( m_iszSentence ) );
return NULL;
return FALSE;
}
BOOL bConcurrent = FALSE;

5
dlls/skill.cpp

@ -25,13 +25,12 @@ skilldata_t gSkillData; @@ -25,13 +25,12 @@ skilldata_t gSkillData;
// take the name of a cvar, tack a digit for the skill level
// on, and return the value.of that Cvar
//=========================================================
float GetSkillCvar( char *pName )
float GetSkillCvar( const char *pName )
{
int iCount;
float flValue;
char szBuffer[64];
iCount = sprintf( szBuffer, "%s%d",pName, gSkillData.iSkillLevel );
sprintf( szBuffer, "%s%d",pName, gSkillData.iSkillLevel );
flValue = CVAR_GET_FLOAT( szBuffer );

2
dlls/skill.h

@ -136,7 +136,7 @@ struct skilldata_t @@ -136,7 +136,7 @@ struct skilldata_t
};
extern DLL_GLOBAL skilldata_t gSkillData;
float GetSkillCvar( char *pName );
float GetSkillCvar( const char *pName );
extern DLL_GLOBAL int g_iSkillLevel;

12
dlls/sound.cpp

@ -448,7 +448,7 @@ void CAmbientGeneric::InitModulationParms( void ) @@ -448,7 +448,7 @@ void CAmbientGeneric::InitModulationParms( void )
{
int pitchinc;
m_dpv.volrun = pev->health * 10; // 0 - 100
m_dpv.volrun = (int)( pev->health * 10 ); // 0 - 100
if( m_dpv.volrun > 100 )
m_dpv.volrun = 100;
if( m_dpv.volrun < 0 )
@ -553,7 +553,7 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, @@ -553,7 +553,7 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller,
if( fraction < 0.0 )
fraction = 0.01;
m_dpv.pitch = fraction * 255;
m_dpv.pitch = (int)( fraction * 255 );
UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, 0, 0, SND_CHANGE_PITCH, m_dpv.pitch );
return;
@ -1610,7 +1610,7 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in @@ -1610,7 +1610,7 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in
const char *pTextureName;
float rgfl1[3];
float rgfl2[3];
char *rgsz[4];
const char *rgsz[4];
int cnt;
float fattn = ATTN_NORM;
@ -1822,7 +1822,7 @@ IMPLEMENT_SAVERESTORE( CSpeaker, CBaseEntity ) @@ -1822,7 +1822,7 @@ IMPLEMENT_SAVERESTORE( CSpeaker, CBaseEntity )
//
void CSpeaker::Spawn( void )
{
char *szSoundFile = (char*) STRING( pev->message );
const char *szSoundFile = STRING( pev->message );
if( !m_preset && ( FStringNull( pev->message ) || strlen( szSoundFile ) < 1 ) )
{
@ -1854,7 +1854,7 @@ void CSpeaker::Precache( void ) @@ -1854,7 +1854,7 @@ void CSpeaker::Precache( void )
}
void CSpeaker::SpeakerThink( void )
{
char* szSoundFile;
const char* szSoundFile = NULL;
float flvolume = pev->health * 0.1;
float flattenuation = 0.3;
int flags = 0;
@ -1911,7 +1911,7 @@ void CSpeaker::SpeakerThink( void ) @@ -1911,7 +1911,7 @@ void CSpeaker::SpeakerThink( void )
}
}
else
szSoundFile = (char*)STRING( pev->message );
szSoundFile = STRING( pev->message );
if( szSoundFile[0] == '!' )
{

12
dlls/squadmonster.cpp

@ -192,7 +192,7 @@ BOOL CSquadMonster::SquadAdd( CSquadMonster *pAdd ) @@ -192,7 +192,7 @@ BOOL CSquadMonster::SquadAdd( CSquadMonster *pAdd )
for( int i = 0; i < MAX_SQUAD_MEMBERS - 1; i++ )
{
if( m_hSquadMember[i] == NULL )
if( m_hSquadMember[i] == 0 )
{
m_hSquadMember[i] = pAdd;
pAdd->m_hSquadLeader = this;
@ -258,7 +258,7 @@ void CSquadMonster::SquadMakeEnemy( CBaseEntity *pEnemy ) @@ -258,7 +258,7 @@ void CSquadMonster::SquadMakeEnemy( CBaseEntity *pEnemy )
// reset members who aren't activly engaged in fighting
if( pMember->m_hEnemy != pEnemy && !pMember->HasConditions( bits_COND_SEE_ENEMY ) )
{
if( pMember->m_hEnemy != NULL )
if( pMember->m_hEnemy != 0 )
{
// remember their current enemy
pMember->PushEnemy( pMember->m_hEnemy, pMember->m_vecEnemyLKP );
@ -459,7 +459,7 @@ BOOL CSquadMonster::NoFriendlyFire( void ) @@ -459,7 +459,7 @@ BOOL CSquadMonster::NoFriendlyFire( void )
Vector v_left;
//!!!BUGBUG - to fix this, the planes must be aligned to where the monster will be firing its gun, not the direction it is facing!!!
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
UTIL_MakeVectors( UTIL_VecToAngles( m_hEnemy->Center() - pev->origin ) );
}
@ -508,9 +508,7 @@ BOOL CSquadMonster::NoFriendlyFire( void ) @@ -508,9 +508,7 @@ BOOL CSquadMonster::NoFriendlyFire( void )
//=========================================================
MONSTERSTATE CSquadMonster::GetIdealState ( void )
{
int iConditions;
iConditions = IScheduleFlags();
IScheduleFlags();
// If no schedule conditions, the new ideal state is probably the reason we're in here.
switch( m_MonsterState )
@ -565,7 +563,7 @@ BOOL CSquadMonster::SquadEnemySplit( void ) @@ -565,7 +563,7 @@ BOOL CSquadMonster::SquadEnemySplit( void )
for( int i = 0; i < MAX_SQUAD_MEMBERS; i++ )
{
CSquadMonster *pMember = pSquadLeader->MySquadMember( i );
if( pMember != NULL && pMember->m_hEnemy != NULL && pMember->m_hEnemy != pEnemy )
if( pMember != NULL && pMember->m_hEnemy != 0 && pMember->m_hEnemy != pEnemy )
{
return TRUE;
}

2
dlls/squadmonster.h

@ -88,7 +88,7 @@ public: @@ -88,7 +88,7 @@ public:
else
return (CSquadMonster *)( (CBaseEntity *)m_hSquadMember[i] );
}
int InSquad( void ) { return m_hSquadLeader != NULL; }
int InSquad( void ) { return m_hSquadLeader != 0; }
int IsLeader( void ) { return m_hSquadLeader == this; }
int SquadJoin( int searchRadius );
int SquadRecruit( int searchRadius, int maxMembers );

16
dlls/squeakgrenade.cpp

@ -94,7 +94,7 @@ int CSqueakGrenade::Classify( void ) @@ -94,7 +94,7 @@ int CSqueakGrenade::Classify( void )
if( m_iMyClass != 0 )
return m_iMyClass; // protect against recursion
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
m_iMyClass = CLASS_INSECT; // no one cares about it
switch( m_hEnemy->Classify() )
@ -180,13 +180,13 @@ void CSqueakGrenade::Killed( entvars_t *pevAttacker, int iGib ) @@ -180,13 +180,13 @@ void CSqueakGrenade::Killed( entvars_t *pevAttacker, int iGib )
UTIL_BloodDrips( pev->origin, g_vecZero, BloodColor(), 80 );
if( m_hOwner != NULL )
if( m_hOwner != 0 )
RadiusDamage( pev, m_hOwner->pev, pev->dmg, CLASS_NONE, DMG_BLAST );
else
RadiusDamage( pev, pev, pev->dmg, CLASS_NONE, DMG_BLAST );
// reset owner so death message happens
if( m_hOwner != NULL )
if( m_hOwner != 0 )
pev->owner = m_hOwner->edict();
CBaseMonster::Killed( pevAttacker, GIB_ALWAYS );
@ -230,7 +230,7 @@ void CSqueakGrenade::HuntThink( void ) @@ -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;
}
@ -241,7 +241,7 @@ void CSqueakGrenade::HuntThink( void ) @@ -241,7 +241,7 @@ void CSqueakGrenade::HuntThink( void )
m_flNextHunt = gpGlobals->time + 2.0;
CBaseEntity *pOther = NULL;
//CBaseEntity *pOther = NULL;
Vector vecDir;
TraceResult tr;
@ -251,7 +251,7 @@ void CSqueakGrenade::HuntThink( void ) @@ -251,7 +251,7 @@ void CSqueakGrenade::HuntThink( void )
UTIL_MakeVectors( pev->angles );
if( m_hEnemy == NULL || !m_hEnemy->IsAlive() )
if( m_hEnemy == 0 || !m_hEnemy->IsAlive() )
{
// find target, bounce a bit towards it.
Look( 512 );
@ -270,7 +270,7 @@ void CSqueakGrenade::HuntThink( void ) @@ -270,7 +270,7 @@ void CSqueakGrenade::HuntThink( void )
if( flpitch < 80 )
flpitch = 80;
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
if( FVisible( m_hEnemy ) )
{
@ -352,7 +352,7 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) @@ -352,7 +352,7 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther )
// ALERT( at_console, "hit enemy\n" );
ClearMultiDamage();
pOther->TraceAttack( pev, gSkillData.snarkDmgBite, gpGlobals->v_forward, &tr, DMG_SLASH );
if( m_hOwner != NULL )
if( m_hOwner != 0 )
ApplyMultiDamage( pev, m_hOwner->pev );
else
ApplyMultiDamage( pev, pev );

32
dlls/talkmonster.cpp

@ -51,7 +51,7 @@ TYPEDESCRIPTION CTalkMonster::m_SaveData[] = @@ -51,7 +51,7 @@ TYPEDESCRIPTION CTalkMonster::m_SaveData[] =
IMPLEMENT_SAVERESTORE( CTalkMonster, CBaseMonster )
// array of friend names
char *CTalkMonster::m_szFriends[TLK_CFRIENDS] =
const char *CTalkMonster::m_szFriends[TLK_CFRIENDS] =
{
"monster_barney",
"monster_scientist",
@ -391,7 +391,7 @@ void CTalkMonster::StartTask( Task_t *pTask ) @@ -391,7 +391,7 @@ void CTalkMonster::StartTask( Task_t *pTask )
case TASK_TLK_EYECONTACT:
break;
case TASK_TLK_IDEALYAW:
if( m_hTalkTarget != NULL )
if( m_hTalkTarget != 0 )
{
pev->yaw_speed = 60;
float yaw = VecToYaw( m_hTalkTarget->pev->origin - pev->origin ) - pev->angles.y;
@ -536,7 +536,7 @@ void CTalkMonster::RunTask( Task_t *pTask ) @@ -536,7 +536,7 @@ void CTalkMonster::RunTask( Task_t *pTask )
}
break;
case TASK_TLK_EYECONTACT:
if( !IsMoving() && IsTalking() && m_hTalkTarget != NULL )
if( !IsMoving() && IsTalking() && m_hTalkTarget != 0 )
{
// ALERT( at_console, "waiting %f\n", m_flStopTalkTime - gpGlobals->time );
IdleHeadTurn( m_hTalkTarget->pev->origin );
@ -561,7 +561,7 @@ void CTalkMonster::RunTask( Task_t *pTask ) @@ -561,7 +561,7 @@ void CTalkMonster::RunTask( Task_t *pTask )
}
break;
case TASK_WAIT_FOR_MOVEMENT:
if( IsTalking() && m_hTalkTarget != NULL )
if( IsTalking() && m_hTalkTarget != 0 )
{
// ALERT( at_console, "walking, talking\n" );
IdleHeadTurn( m_hTalkTarget->pev->origin );
@ -582,7 +582,7 @@ void CTalkMonster::RunTask( Task_t *pTask ) @@ -582,7 +582,7 @@ void CTalkMonster::RunTask( Task_t *pTask )
IdleHeadTurn( pev->origin );
break;
default:
if( IsTalking() && m_hTalkTarget != NULL )
if( IsTalking() && m_hTalkTarget != 0 )
{
IdleHeadTurn( m_hTalkTarget->pev->origin );
}
@ -603,7 +603,7 @@ void CTalkMonster::Killed( entvars_t *pevAttacker, int iGib ) @@ -603,7 +603,7 @@ void CTalkMonster::Killed( entvars_t *pevAttacker, int iGib )
LimitFollowers( CBaseEntity::Instance( pevAttacker ), 0 );
}
m_hTargetEnt = NULL;
m_hTargetEnt = 0;
// Don't finish that sentence
StopTalking();
SetUse( NULL );
@ -613,7 +613,7 @@ void CTalkMonster::Killed( entvars_t *pevAttacker, int iGib ) @@ -613,7 +613,7 @@ void CTalkMonster::Killed( entvars_t *pevAttacker, int iGib )
CBaseEntity *CTalkMonster::EnumFriends( CBaseEntity *pPrevious, int listNumber, BOOL bTrace )
{
CBaseEntity *pFriend = pPrevious;
char *pszFriend;
const char *pszFriend;
TraceResult tr;
Vector vecCheck;
@ -712,7 +712,7 @@ void CTalkMonster::LimitFollowers( CBaseEntity *pPlayer, int maxFollowers ) @@ -712,7 +712,7 @@ void CTalkMonster::LimitFollowers( CBaseEntity *pPlayer, int maxFollowers )
float CTalkMonster::TargetDistance( void )
{
// If we lose the player, or he dies, return a really large distance
if( m_hTargetEnt == NULL || !m_hTargetEnt->IsAlive() )
if( m_hTargetEnt == 0 || !m_hTargetEnt->IsAlive() )
return 1e6;
return ( m_hTargetEnt->pev->origin - pev->origin ).Length();
@ -764,7 +764,7 @@ CBaseEntity *CTalkMonster::FindNearestFriend( BOOL fPlayer ) @@ -764,7 +764,7 @@ CBaseEntity *CTalkMonster::FindNearestFriend( BOOL fPlayer )
Vector vecStart = pev->origin;
Vector vecCheck;
int i;
char *pszFriend;
const char *pszFriend;
int cfriends;
vecStart.z = pev->absmax.z;
@ -855,7 +855,7 @@ void CTalkMonster::Touch( CBaseEntity *pOther ) @@ -855,7 +855,7 @@ void CTalkMonster::Touch( CBaseEntity *pOther )
//=========================================================
void CTalkMonster::IdleRespond( void )
{
int pitch = GetVoicePitch();
//int pitch = GetVoicePitch();
// play response
PlaySentence( m_szGrp[TLK_ANSWER], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE );
@ -890,7 +890,7 @@ int CTalkMonster::FOkToSpeak( void ) @@ -890,7 +890,7 @@ int CTalkMonster::FOkToSpeak( void )
return FALSE;
// don't talk if you're in combat
if( m_hEnemy != NULL && FVisible( m_hEnemy ) )
if( m_hEnemy != 0 && FVisible( m_hEnemy ) )
return FALSE;
return TRUE;
@ -977,7 +977,7 @@ void CTalkMonster::IdleHeadTurn( Vector &vecFriend ) @@ -977,7 +977,7 @@ void CTalkMonster::IdleHeadTurn( Vector &vecFriend )
int CTalkMonster::FIdleSpeak( void )
{
// try to start a conversation, or make statement
int pitch;
//int pitch;
const char *szIdleGroup;
const char *szQuestionGroup;
float duration;
@ -1001,7 +1001,7 @@ int CTalkMonster::FIdleSpeak( void ) @@ -1001,7 +1001,7 @@ int CTalkMonster::FIdleSpeak( void )
duration = RANDOM_FLOAT( 2.8, 3.2 );
}
pitch = GetVoicePitch();
//pitch = GetVoicePitch();
// player using this entity is alive and wounded?
CBaseEntity *pTarget = m_hTargetEnt;
@ -1315,10 +1315,10 @@ void CTalkMonster::StopFollowing( BOOL clearSchedule ) @@ -1315,10 +1315,10 @@ void CTalkMonster::StopFollowing( BOOL clearSchedule )
if( m_movementGoal == MOVEGOAL_TARGETENT )
RouteClear(); // Stop him from walking toward the player
m_hTargetEnt = NULL;
m_hTargetEnt = 0;
if( clearSchedule )
ClearSchedule();
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
m_IdealMonsterState = MONSTERSTATE_COMBAT;
}
}
@ -1328,7 +1328,7 @@ void CTalkMonster::StartFollowing( CBaseEntity *pLeader ) @@ -1328,7 +1328,7 @@ void CTalkMonster::StartFollowing( CBaseEntity *pLeader )
if( m_pCine )
m_pCine->CancelScript();
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
m_IdealMonsterState = MONSTERSTATE_ALERT;
m_hTargetEnt = pLeader;

4
dlls/talkmonster.h

@ -138,7 +138,7 @@ public: @@ -138,7 +138,7 @@ public:
// For following
BOOL CanFollow( void );
BOOL IsFollowing( void ) { return m_hTargetEnt != NULL && m_hTargetEnt->IsPlayer(); }
BOOL IsFollowing( void ) { return m_hTargetEnt != 0 && m_hTargetEnt->IsPlayer(); }
void StopFollowing( BOOL clearSchedule );
void StartFollowing( CBaseEntity *pLeader );
virtual void DeclineFollowing( void ) {}
@ -154,7 +154,7 @@ public: @@ -154,7 +154,7 @@ public:
static TYPEDESCRIPTION m_SaveData[];
static char *m_szFriends[TLK_CFRIENDS]; // array of friend names
static const char *m_szFriends[TLK_CFRIENDS]; // array of friend names
static float g_talkWaitTime;
int m_bitsSaid; // set bits for sentences we don't want repeated

10
dlls/teamplay_gamerules.cpp

@ -116,7 +116,7 @@ void CHalfLifeTeamplay::Think( void ) @@ -116,7 +116,7 @@ void CHalfLifeTeamplay::Think( void )
return;
}
remain = flFragLimit - team_scores[i];
remain = (int)( flFragLimit - team_scores[i] );
if( remain < bestfrags )
{
bestfrags = remain;
@ -157,7 +157,7 @@ BOOL CHalfLifeTeamplay::ClientCommand( CBasePlayer *pPlayer, const char *pcmd ) @@ -157,7 +157,7 @@ BOOL CHalfLifeTeamplay::ClientCommand( CBasePlayer *pPlayer, const char *pcmd )
if( CMD_ARGC() < 2 )
return TRUE;
int slot = atoi( CMD_ARGV( 1 ) );
//int slot = atoi( CMD_ARGV( 1 ) );
// select the item from the current menu
return TRUE;
@ -241,7 +241,7 @@ void CHalfLifeTeamplay::InitHUD( CBasePlayer *pPlayer ) @@ -241,7 +241,7 @@ void CHalfLifeTeamplay::InitHUD( CBasePlayer *pPlayer )
ChangePlayerTeam( pPlayer, pPlayer->m_szTeamName, FALSE, FALSE );
UTIL_SayText( text, pPlayer );
int clientIndex = pPlayer->entindex();
//int clientIndex = pPlayer->entindex();
RecountTeams();
// update this player with all the other players team info
// loop through all active players and send their team info to the new client
@ -300,7 +300,7 @@ void CHalfLifeTeamplay::ChangePlayerTeam( CBasePlayer *pPlayer, const char *pTea @@ -300,7 +300,7 @@ void CHalfLifeTeamplay::ChangePlayerTeam( CBasePlayer *pPlayer, const char *pTea
MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
WRITE_BYTE( clientIndex );
WRITE_SHORT( pPlayer->pev->frags );
WRITE_SHORT( (int)pPlayer->pev->frags );
WRITE_SHORT( pPlayer->m_iDeaths );
WRITE_SHORT( 0 );
WRITE_SHORT( g_pGameRules->GetTeamIndex( pPlayer->m_szTeamName ) + 1 );
@ -607,7 +607,7 @@ void CHalfLifeTeamplay::RecountTeams( bool bResendInfo ) @@ -607,7 +607,7 @@ void CHalfLifeTeamplay::RecountTeams( bool bResendInfo )
if( tm >= 0 )
{
team_scores[tm] += plr->pev->frags;
team_scores[tm] += (int)plr->pev->frags;
}
if( bResendInfo ) //Someone's info changed, let's send the team info again.

9
dlls/tentacle.cpp

@ -486,12 +486,12 @@ void CTentacle::Cycle( void ) @@ -486,12 +486,12 @@ void CTentacle::Cycle( void )
m_flSoundYaw += 360;
if( m_flSoundYaw > 180 )
m_flSoundYaw -= 360;
#if 0
// ALERT( at_console, "sound %d %.0f\n", m_iSoundLevel, m_flSoundYaw );
if( m_flSoundTime < gpGlobals->time )
{
// play "I hear new something" sound
char *sound;
const char *sound;
switch( RANDOM_LONG( 0, 1 ) )
{
@ -505,6 +505,7 @@ void CTentacle::Cycle( void ) @@ -505,6 +505,7 @@ void CTentacle::Cycle( void )
// UTIL_EmitAmbientSound( ENT( pev ), pev->origin + Vector( 0, 0, MyHeight() ), sound, 1.0, ATTN_NORM, 0, 100 );
}
#endif
m_flSoundTime = gpGlobals->time + RANDOM_FLOAT( 5.0, 10.0 );
}
@ -591,7 +592,7 @@ void CTentacle::Cycle( void ) @@ -591,7 +592,7 @@ void CTentacle::Cycle( void )
if( m_flNextSong < gpGlobals->time )
{
// play "I hear new something" sound
char *sound;
const char *sound;
switch( RANDOM_LONG( 0, 1 ) )
{
@ -791,7 +792,7 @@ void CTentacle::DieThink( void ) @@ -791,7 +792,7 @@ void CTentacle::DieThink( void )
void CTentacle::HandleAnimEvent( MonsterEvent_t *pEvent )
{
char *sound;
const char *sound;
switch( pEvent->event )
{

10
dlls/triggers.cpp

@ -1265,7 +1265,7 @@ void CTriggerVolume::Spawn( void ) @@ -1265,7 +1265,7 @@ void CTriggerVolume::Spawn( void )
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
SET_MODEL( ENT(pev), STRING( pev->model ) ); // set size and link into world
pev->model = NULL;
pev->model = 0;
pev->modelindex = 0;
}
@ -1438,7 +1438,7 @@ void CChangeLevel::UseChangeLevel( CBaseEntity *pActivator, CBaseEntity *pCaller @@ -1438,7 +1438,7 @@ void CChangeLevel::UseChangeLevel( CBaseEntity *pActivator, CBaseEntity *pCaller
void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
{
edict_t *pentLandmark;
LEVELLIST levels[16];
//LEVELLIST levels[16];
ASSERT( !FStrEq( m_szMapName, "" ) );
@ -2224,7 +2224,7 @@ void CTriggerCamera::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP @@ -2224,7 +2224,7 @@ void CTriggerCamera::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
}
// Nothing to look at!
if( m_hTarget == NULL )
if( m_hTarget == 0 )
{
return;
}
@ -2280,10 +2280,10 @@ void CTriggerCamera::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP @@ -2280,10 +2280,10 @@ void CTriggerCamera::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
void CTriggerCamera::FollowTarget()
{
if( m_hPlayer == NULL )
if( m_hPlayer == 0 )
return;
if( m_hTarget == NULL || m_flReturnTime < gpGlobals->time )
if( m_hTarget == 0 || m_flReturnTime < gpGlobals->time )
{
if( m_hPlayer->IsAlive() )
{

8
dlls/tripmine.cpp

@ -162,7 +162,7 @@ void CTripmineGrenade::PowerupThink( void ) @@ -162,7 +162,7 @@ void CTripmineGrenade::PowerupThink( void )
{
TraceResult tr;
if( m_hOwner == NULL )
if( m_hOwner == 0 )
{
// find an owner
edict_t *oldowner = pev->owner;
@ -217,7 +217,7 @@ void CTripmineGrenade::PowerupThink( void ) @@ -217,7 +217,7 @@ void CTripmineGrenade::PowerupThink( void )
MakeBeam();
// play enabled sound
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "weapons/mine_activate.wav", 0.5, ATTN_NORM, 1.0, 75 );
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "weapons/mine_activate.wav", 0.5, ATTN_NORM, 1, 75 );
}
pev->nextthink = gpGlobals->time + 0.1;
}
@ -280,7 +280,7 @@ void CTripmineGrenade::BeamBreakThink( void ) @@ -280,7 +280,7 @@ void CTripmineGrenade::BeamBreakThink( void )
}
else
{
if( m_hOwner == NULL )
if( m_hOwner == 0 )
bBlowup = 1;
else if( m_posOwner != m_hOwner->pev->origin )
bBlowup = 1;
@ -446,7 +446,7 @@ void CTripmine::PrimaryAttack( void ) @@ -446,7 +446,7 @@ void CTripmine::PrimaryAttack( void )
{
Vector angles = UTIL_VecToAngles( tr.vecPlaneNormal );
CBaseEntity *pEnt = CBaseEntity::Create( "monster_tripmine", tr.vecEndPos + tr.vecPlaneNormal * 8, angles, m_pPlayer->edict() );
CBaseEntity::Create( "monster_tripmine", tr.vecEndPos + tr.vecPlaneNormal * 8, angles, m_pPlayer->edict() );
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;

18
dlls/turret.cpp

@ -456,7 +456,7 @@ void CBaseTurret::ActiveThink( void ) @@ -456,7 +456,7 @@ void CBaseTurret::ActiveThink( void )
pev->nextthink = gpGlobals->time + 0.1;
StudioFrameAdvance();
if( ( !m_iOn ) || ( m_hEnemy == NULL ) )
if( ( !m_iOn ) || ( m_hEnemy == 0 ) )
{
m_hEnemy = NULL;
m_flLastSight = gpGlobals->time + m_flMaxWait;
@ -826,21 +826,21 @@ void CBaseTurret::SearchThink( void ) @@ -826,21 +826,21 @@ void CBaseTurret::SearchThink( void )
Ping();
// If we have a target and we're still healthy
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
if( !m_hEnemy->IsAlive() )
m_hEnemy = NULL;// Dead enemy forces a search for new one
}
// Acquire Target
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
Look( TURRET_RANGE );
m_hEnemy = BestVisibleEnemy();
}
// If we've found a target, spin up the barrel and start to attack
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
m_flLastSight = 0;
m_flSpinUpTime = 0;
@ -881,20 +881,20 @@ void CBaseTurret::AutoSearchThink( void ) @@ -881,20 +881,20 @@ void CBaseTurret::AutoSearchThink( void )
pev->nextthink = gpGlobals->time + 0.3;
// If we have a target and we're still healthy
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
if( !m_hEnemy->IsAlive() )
m_hEnemy = NULL;// Dead enemy forces a search for new one
}
// Acquire Target
if( m_hEnemy == NULL )
if( m_hEnemy == 0 )
{
Look( TURRET_RANGE );
m_hEnemy = BestVisibleEnemy();
}
if( m_hEnemy != NULL )
if( m_hEnemy != 0 )
{
SetThink( &CBaseTurret::Deploy );
EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_alert.wav", TURRET_MACHINE_VOLUME, ATTN_NORM );
@ -903,7 +903,7 @@ void CBaseTurret::AutoSearchThink( void ) @@ -903,7 +903,7 @@ void CBaseTurret::AutoSearchThink( void )
void CBaseTurret::TurretDeath( void )
{
BOOL iActive = FALSE;
//BOOL iActive = FALSE;
StudioFrameAdvance();
pev->nextthink = gpGlobals->time + 0.1;
@ -1222,7 +1222,7 @@ void CSentry::SentryTouch( CBaseEntity *pOther ) @@ -1222,7 +1222,7 @@ void CSentry::SentryTouch( CBaseEntity *pOther )
void CSentry::SentryDeath( void )
{
BOOL iActive = FALSE;
//BOOL iActive = FALSE;
StudioFrameAdvance();
pev->nextthink = gpGlobals->time + 0.1;

20
dlls/util.cpp

@ -118,7 +118,7 @@ float UTIL_SharedRandomFloat( unsigned int seed, float low, float high ) @@ -118,7 +118,7 @@ float UTIL_SharedRandomFloat( unsigned int seed, float low, float high )
U_Random();
U_Random();
range = high - low;
range = (int)( high - low );
if( !range )
{
return low;
@ -625,7 +625,7 @@ static unsigned short FixedUnsigned16( float value, float scale ) @@ -625,7 +625,7 @@ static unsigned short FixedUnsigned16( float value, float scale )
{
int output;
output = value * scale;
output = (int)( value * scale );
if( output < 0 )
output = 0;
if( output > 0xFFFF )
@ -638,7 +638,7 @@ static short FixedSigned16( float value, float scale ) @@ -638,7 +638,7 @@ static short FixedSigned16( float value, float scale )
{
int output;
output = value * scale;
output = (int)( value * scale );
if( output > 32767 )
output = 32767;
@ -937,10 +937,10 @@ TraceResult UTIL_GetGlobalTrace( ) @@ -937,10 +937,10 @@ TraceResult UTIL_GetGlobalTrace( )
{
TraceResult tr;
tr.fAllSolid = gpGlobals->trace_allsolid;
tr.fStartSolid = gpGlobals->trace_startsolid;
tr.fInOpen = gpGlobals->trace_inopen;
tr.fInWater = gpGlobals->trace_inwater;
tr.fAllSolid = (int)gpGlobals->trace_allsolid;
tr.fStartSolid = (int)gpGlobals->trace_startsolid;
tr.fInOpen = (int)gpGlobals->trace_inopen;
tr.fInWater = (int)gpGlobals->trace_inwater;
tr.flFraction = gpGlobals->trace_fraction;
tr.flPlaneDist = gpGlobals->trace_plane_dist;
tr.pHit = gpGlobals->trace_ent;
@ -1033,7 +1033,7 @@ float UTIL_SplineFraction( float value, float scale ) @@ -1033,7 +1033,7 @@ float UTIL_SplineFraction( float value, float scale )
return 3 * valueSquared - 2 * valueSquared * value;
}
char *UTIL_VarArgs( char *format, ... )
char *UTIL_VarArgs( const char *format, ... )
{
va_list argptr;
static char string[1024];
@ -1536,7 +1536,7 @@ void UTIL_PrecacheOther( const char *szClassname ) @@ -1536,7 +1536,7 @@ void UTIL_PrecacheOther( const char *szClassname )
// UTIL_LogPrintf - Prints a logged message to console.
// Preceded by LOG: ( timestamp ) < message >
//=========================================================
void UTIL_LogPrintf( char *fmt, ... )
void UTIL_LogPrintf( const char *fmt, ... )
{
va_list argptr;
static char string[1024];
@ -1902,7 +1902,7 @@ void EntvarsKeyvalue( entvars_t *pev, KeyValueData *pkvd ) @@ -1902,7 +1902,7 @@ void EntvarsKeyvalue( entvars_t *pev, KeyValueData *pkvd )
int i;
TYPEDESCRIPTION *pField;
for( i = 0; i < ENTVARS_COUNT; i++ )
for( i = 0; i < (int)ENTVARS_COUNT; i++ )
{
pField = &gEntvarsDescription[i];

9
dlls/util.h

@ -87,8 +87,9 @@ typedef int EOFFSET; @@ -87,8 +87,9 @@ typedef int EOFFSET;
typedef int BOOL;
// In case this ever changes
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
// Keeps clutter down a bit, when declaring external entity/global method prototypes
#define DECLARE_GLOBAL_METHOD(MethodName) extern void DLLEXPORT MethodName( void )
#define GLOBAL_METHOD(funcname) void DLLEXPORT funcname(void)
@ -304,7 +305,7 @@ extern float UTIL_Approach( float target, float value, float speed ); @@ -304,7 +305,7 @@ extern float UTIL_Approach( float target, float value, float speed );
extern float UTIL_ApproachAngle( float target, float value, float speed );
extern float UTIL_AngleDistance( float next, float cur );
extern char *UTIL_VarArgs( char *format, ... );
extern char *UTIL_VarArgs( const char *format, ... );
extern void UTIL_Remove( CBaseEntity *pEntity );
extern BOOL UTIL_IsValidEntity( edict_t *pent );
extern BOOL UTIL_TeamsMatch( const char *pTeamName1, const char *pTeamName2 );
@ -364,7 +365,7 @@ extern char *UTIL_dtos3( int d ); @@ -364,7 +365,7 @@ extern char *UTIL_dtos3( int d );
extern char *UTIL_dtos4( int d );
// Writes message to console with timestamp and FragLog header.
extern void UTIL_LogPrintf( char *fmt, ... );
extern void UTIL_LogPrintf( const char *fmt, ... );
// Sorta like FInViewCone, but for nonmonsters.
extern float UTIL_DotPoints ( const Vector &vecSrc, const Vector &vecCheck, const Vector &vecDir );
@ -534,7 +535,7 @@ void EMIT_GROUPID_SUIT(edict_t *entity, int isentenceg); @@ -534,7 +535,7 @@ void EMIT_GROUPID_SUIT(edict_t *entity, int isentenceg);
void EMIT_GROUPNAME_SUIT(edict_t *entity, const char *groupname);
#define PRECACHE_SOUND_ARRAY( a ) \
{ for (int i = 0; i < ARRAYSIZE( a ); i++ ) PRECACHE_SOUND((char *) a [i]); }
{ for (int i = 0; i < (int)ARRAYSIZE( a ); i++ ) PRECACHE_SOUND((char *) a [i]); }
#define EMIT_SOUND_ARRAY_DYN( chan, array ) \
EMIT_SOUND_DYN ( ENT(pev), chan , array [ RANDOM_LONG(0,ARRAYSIZE( array )-1) ], 1.0, ATTN_NORM, 0, RANDOM_LONG(95,105) );

14
dlls/vector.h

@ -22,8 +22,8 @@ @@ -22,8 +22,8 @@
class Vector2D
{
public:
inline Vector2D(void) { }
inline Vector2D(float X, float Y) { x = X; y = Y; }
inline Vector2D(void): x( 0.0f ), y( 0.0f ) { }
inline Vector2D(float X, float Y): x( 0.0f ), y( 0.0f ) { x = X; y = Y; }
inline Vector2D operator+(const Vector2D& v) const { return Vector2D( x + v.x, y + v.y ); }
inline Vector2D operator-(const Vector2D& v) const { return Vector2D( x - v.x, y - v.y ); }
inline Vector2D operator*(float fl) const { return Vector2D( x * fl, y * fl ); }
@ -33,7 +33,7 @@ public: @@ -33,7 +33,7 @@ public:
inline Vector2D Normalize ( void ) const
{
Vector2D vec2;
//Vector2D vec2;
float flLen = Length();
if( flLen == 0 )
@ -60,12 +60,12 @@ class Vector // same data-layout as engine's vec3_t, @@ -60,12 +60,12 @@ class Vector // same data-layout as engine's vec3_t,
{ // which is a vec_t[3]
public:
// Construction/destruction
inline Vector( void ) { }
inline Vector( float X, float Y, float Z ) { x = X; y = Y; z = Z; }
inline Vector( void ): x( 0.0f ), y( 0.0f ), z( 0.0f ) { }
inline Vector( float X, float Y, float Z ): x( 0.0f ), y( 0.0f ), z( 0.0f ) { x = X; y = Y; z = Z; }
//inline Vector( double X, double Y, double Z ) { x = (float)X; y = (float)Y; z = (float)Z; }
//inline Vector( int X, int Y, int Z ) { x = (float)X; y = (float)Y; z = (float)Z; }
inline Vector( const Vector& v ) { x = v.x; y = v.y; z = v.z; }
inline Vector( float rgfl[3] ) { x = rgfl[0]; y = rgfl[1]; z = rgfl[2]; }
inline Vector( const Vector& v ): x( 0.0f ), y( 0.0f ), z( 0.0f ) { x = v.x; y = v.y; z = v.z; }
inline Vector( float rgfl[3] ): x( 0.0f ), y( 0.0f ), z( 0.0f ) { x = rgfl[0]; y = rgfl[1]; z = rgfl[2]; }
// Operators
inline Vector operator-( void ) const { return Vector( -x, -y, -z ); }

4
dlls/weapons.cpp

@ -935,7 +935,7 @@ BOOL CBasePlayerWeapon::CanDeploy( void ) @@ -935,7 +935,7 @@ BOOL CBasePlayerWeapon::CanDeploy( void )
return TRUE;
}
BOOL CBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal /* = 0 */, int body )
BOOL CBasePlayerWeapon::DefaultDeploy( const char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal /* = 0 */, int body )
{
if( !CanDeploy() )
return FALSE;
@ -1400,7 +1400,7 @@ BOOL CWeaponBox::PackAmmo( int iszName, int iCount ) @@ -1400,7 +1400,7 @@ BOOL CWeaponBox::PackAmmo( int iszName, int iCount )
//=========================================================
// CWeaponBox - GiveAmmo
//=========================================================
int CWeaponBox::GiveAmmo( int iCount, char *szName, int iMax, int *pIndex/* = NULL*/ )
int CWeaponBox::GiveAmmo( int iCount, const char *szName, int iMax, int *pIndex/* = NULL*/ )
{
int i;

8
dlls/weapons.h

@ -310,7 +310,7 @@ public: @@ -310,7 +310,7 @@ public:
virtual BOOL CanDeploy( void );
virtual BOOL IsUseable( void );
BOOL DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0, int body = 0 );
BOOL DefaultDeploy( const char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0, int body = 0 );
int DefaultReload( int iClipSize, int iAnim, float fDelay, int body = 0 );
virtual void ItemPostFrame( void ); // called each frame by the player PostThink
@ -430,7 +430,7 @@ class CWeaponBox : public CBaseEntity @@ -430,7 +430,7 @@ class CWeaponBox : public CBaseEntity
void Touch( CBaseEntity *pOther );
void KeyValue( KeyValueData *pkvd );
BOOL IsEmpty( void );
int GiveAmmo( int iCount, char *szName, int iMax, int *pIndex = NULL );
int GiveAmmo( int iCount, const char *szName, int iMax, int *pIndex = NULL );
void SetObjectCollisionBox( void );
public:
@ -453,7 +453,7 @@ public: @@ -453,7 +453,7 @@ public:
#ifdef CLIENT_DLL
bool bIsMultiplayer ( void );
void LoadVModel ( char *szViewModel, CBasePlayer *m_pPlayer );
void LoadVModel ( const char *szViewModel, CBasePlayer *m_pPlayer );
#endif
class CGlock : public CBasePlayerWeapon
@ -828,7 +828,9 @@ public: @@ -828,7 +828,9 @@ public:
unsigned short m_usEgonStop;
private:
#ifndef CLIENT_DLL
float m_shootTime;
#endif
EGON_FIREMODE m_fireMode;
float m_shakeTime;
BOOL m_deployed;

4
dlls/world.cpp

@ -292,7 +292,7 @@ globalentity_t *CGlobalState::Find( string_t globalname ) @@ -292,7 +292,7 @@ globalentity_t *CGlobalState::Find( string_t globalname )
//#ifdef _DEBUG
void CGlobalState::DumpGlobals( void )
{
static char *estates[] = { "Off", "On", "Dead" };
static const char *estates[] = { "Off", "On", "Dead" };
globalentity_t *pTest;
ALERT( at_console, "-- Globals --\n" );
@ -582,7 +582,7 @@ void CWorld::Precache( void ) @@ -582,7 +582,7 @@ void CWorld::Precache( void )
// 63 testing
LIGHT_STYLE( 63, "a" );
for( int i = 0; i < ARRAYSIZE( gDecals ); i++ )
for( int i = 0; i < (int)ARRAYSIZE( gDecals ); i++ )
gDecals[i].index = DECAL_INDEX( gDecals[i].name );
// init the WorldGraph.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save