Browse Source

#ifdef->#if.

theyhunger
Andrey Akhmichin 4 years ago
parent
commit
d069212e0f
  1. 2
      cl_dll/hl/hl_weapons.cpp
  2. 4
      dlls/glock.cpp
  3. 6
      dlls/hunger/ap9.cpp
  4. 2
      dlls/hunger/chaingun.cpp
  5. 10
      dlls/hunger/shovel.cpp
  6. 6
      dlls/hunger/sniper.cpp
  7. 10
      dlls/hunger/spanner.cpp
  8. 2
      dlls/hunger/taurus.cpp
  9. 6
      dlls/hunger/tfcsniper.cpp
  10. 2
      dlls/weapons.cpp
  11. 32
      dlls/weapons.h

2
cl_dll/hl/hl_weapons.cpp

@ -938,7 +938,7 @@ void _DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s
{ {
g_runfuncs = runfuncs; g_runfuncs = runfuncs;
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
if( cl_lw && cl_lw->value ) if( cl_lw && cl_lw->value )
{ {
HUD_WeaponsPostThink( from, to, cmd, time, random_seed ); HUD_WeaponsPostThink( from, to, cmd, time, random_seed );

4
dlls/glock.cpp

@ -54,7 +54,7 @@ void CGlock::Spawn()
Precache(); Precache();
m_iId = WEAPON_GLOCK; m_iId = WEAPON_GLOCK;
#ifdef CLIENT_DLL #if CLIENT_DLL
if( bIsMultiplayer() ) if( bIsMultiplayer() )
#else #else
if( g_pGameRules->IsMultiplayer() ) if( g_pGameRules->IsMultiplayer() )
@ -137,7 +137,7 @@ void CGlock::Holster( int skiplocal /*= 0*/ )
void CGlock::SecondaryAttack() void CGlock::SecondaryAttack()
{ {
#ifdef CLIENT_DLL #if CLIENT_DLL
if( bIsMultiplayer() ) if( bIsMultiplayer() )
#else #else
if( g_pGameRules->IsMultiplayer() ) if( g_pGameRules->IsMultiplayer() )

6
dlls/hunger/ap9.cpp

@ -132,7 +132,7 @@ void CWeaponEinarAP9::AP9Fire( float flSpread, float flCycleTime, BOOL fUseAutoA
int flags; int flags;
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
flags = FEV_NOTHOST; flags = FEV_NOTHOST;
#else #else
flags = 0; flags = 0;
@ -156,7 +156,7 @@ void CWeaponEinarAP9::AP9Fire( float flSpread, float flCycleTime, BOOL fUseAutoA
vecAiming = gpGlobals->v_forward; vecAiming = gpGlobals->v_forward;
} }
#ifdef CLIENT_DLL #if CLIENT_DLL
if( bIsMultiplayer() ) if( bIsMultiplayer() )
#else #else
if( g_pGameRules->IsMultiplayer() ) if( g_pGameRules->IsMultiplayer() )
@ -184,7 +184,7 @@ void CWeaponEinarAP9::Reload()
if( DefaultReload( AP9_MAX_CLIP, AP9_RELOAD, 1.8 ) ) if( DefaultReload( AP9_MAX_CLIP, AP9_RELOAD, 1.8 ) )
{ {
#ifdef CLIENT_DLL #if CLIENT_DLL
if( !bIsMultiplayer() ) if( !bIsMultiplayer() )
#else #else
if( !g_pGameRules->IsMultiplayer() ) if( !g_pGameRules->IsMultiplayer() )

2
dlls/hunger/chaingun.cpp

@ -142,7 +142,7 @@ void CWeaponEinarChaingun::PrimaryAttack()
{ {
if( m_flNextPrimaryAttack <= UTIL_WeaponTimeBase() ) if( m_flNextPrimaryAttack <= UTIL_WeaponTimeBase() )
{ {
#ifdef CLIENT_DLL #if CLIENT_DLL
if( !bIsMultiplayer() ) if( !bIsMultiplayer() )
#else #else
if( !g_pGameRules->IsMultiplayer() ) if( !g_pGameRules->IsMultiplayer() )

10
dlls/hunger/shovel.cpp

@ -142,7 +142,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr );
#ifndef CLIENT_DLL #if !CLIENT_DLL
if( tr.flFraction >= 1.0f ) if( tr.flFraction >= 1.0f )
{ {
UTIL_TraceHull( vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT( m_pPlayer->pev ), &tr ); UTIL_TraceHull( vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT( m_pPlayer->pev ), &tr );
@ -180,7 +180,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
// player "shoot" animation // player "shoot" animation
m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
#ifdef CROWBAR_IDLE_ANIM #if CROWBAR_IDLE_ANIM
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
#endif #endif
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/cbar_miss1.wav", 1, ATTN_NORM, 0, 94 + RANDOM_LONG( 0, 0xF ) ); EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/cbar_miss1.wav", 1, ATTN_NORM, 0, 94 + RANDOM_LONG( 0, 0xF ) );
@ -204,7 +204,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
// player "shoot" animation // player "shoot" animation
m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
#ifndef CLIENT_DLL #if !CLIENT_DLL
// hit // hit
fDidHit = TRUE; fDidHit = TRUE;
@ -320,13 +320,13 @@ int CWeaponEinarShovel::Swing( int fFirst )
SetThink( &CWeaponEinarShovel::Smack ); SetThink( &CWeaponEinarShovel::Smack );
pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; pev->nextthink = UTIL_WeaponTimeBase() + 0.2f;
} }
#ifdef CROWBAR_IDLE_ANIM #if CROWBAR_IDLE_ANIM
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
#endif #endif
return fDidHit; return fDidHit;
} }
#ifdef CROWBAR_IDLE_ANIM #if CROWBAR_IDLE_ANIM
void CWeaponEinarShovel::WeaponIdle( void ) void CWeaponEinarShovel::WeaponIdle( void )
{ {
if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() ) if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() )

6
dlls/hunger/sniper.cpp

@ -119,7 +119,7 @@ void CWeaponEinarSniper::SecondaryAttack()
m_fInZoom = 1; m_fInZoom = 1;
SetBits( iFadeFlags, FFADE_OUT | FFADE_STAYOUT ); SetBits( iFadeFlags, FFADE_OUT | FFADE_STAYOUT );
} }
#ifndef CLIENT_DLL #if !CLIENT_DLL
UTIL_ScreenFade( m_pPlayer, Vector( 0, 255, 0 ), 0.0, 0.0, 70, iFadeFlags ); UTIL_ScreenFade( m_pPlayer, Vector( 0, 255, 0 ), 0.0, 0.0, 70, iFadeFlags );
#endif #endif
pev->nextthink = UTIL_WeaponTimeBase() + 0.11f; pev->nextthink = UTIL_WeaponTimeBase() + 0.11f;
@ -159,7 +159,7 @@ void CWeaponEinarSniper::PrimaryAttack()
Vector vecSrc = m_pPlayer->GetGunPosition(); Vector vecSrc = m_pPlayer->GetGunPosition();
Vector vecAiming = gpGlobals->v_forward; Vector vecAiming = gpGlobals->v_forward;
#ifdef CLIENT_DLL #if CLIENT_DLL
if( bIsMultiplayer() ) if( bIsMultiplayer() )
#else #else
if( g_pGameRules->IsMultiplayer() ) if( g_pGameRules->IsMultiplayer() )
@ -192,7 +192,7 @@ void CWeaponEinarSniper::PrimaryAttack()
Vector vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, Vector( flSpread, flSpread, flSpread ), 8192, BULLET_PLAYER_357, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed ); Vector vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, Vector( flSpread, flSpread, flSpread ), 8192, BULLET_PLAYER_357, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
int flags; int flags;
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
flags = FEV_NOTHOST; flags = FEV_NOTHOST;
#else #else
flags = 0; flags = 0;

10
dlls/hunger/spanner.cpp

@ -137,7 +137,7 @@ int CWeaponEinarSpanner::Swing( int fFirst )
UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr );
#ifndef CLIENT_DLL #if !CLIENT_DLL
if( tr.flFraction >= 1.0f ) if( tr.flFraction >= 1.0f )
{ {
UTIL_TraceHull( vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT( m_pPlayer->pev ), &tr ); UTIL_TraceHull( vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT( m_pPlayer->pev ), &tr );
@ -171,7 +171,7 @@ int CWeaponEinarSpanner::Swing( int fFirst )
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.4f; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.4f;
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/cbar_miss1.wav", 1, ATTN_NORM, 0, 94 + RANDOM_LONG( 0, 0xF ) ); EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/cbar_miss1.wav", 1, ATTN_NORM, 0, 94 + RANDOM_LONG( 0, 0xF ) );
#ifdef CROWBAR_IDLE_ANIM #if CROWBAR_IDLE_ANIM
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
#endif #endif
// player "shoot" animation // player "shoot" animation
@ -192,7 +192,7 @@ int CWeaponEinarSpanner::Swing( int fFirst )
// player "shoot" animation // player "shoot" animation
m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
#ifndef CLIENT_DLL #if !CLIENT_DLL
// hit // hit
fDidHit = TRUE; fDidHit = TRUE;
CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit );
@ -306,13 +306,13 @@ int CWeaponEinarSpanner::Swing( int fFirst )
SetThink( &CWeaponEinarSpanner::Smack ); SetThink( &CWeaponEinarSpanner::Smack );
pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; pev->nextthink = UTIL_WeaponTimeBase() + 0.2f;
} }
#ifdef CROWBAR_IDLE_ANIM #if CROWBAR_IDLE_ANIM
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
#endif #endif
return fDidHit; return fDidHit;
} }
#ifdef CROWBAR_IDLE_ANIM #if CROWBAR_IDLE_ANIM
void CWeaponEinarSpanner::WeaponIdle() void CWeaponEinarSpanner::WeaponIdle()
{ {
if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() ) if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() )

2
dlls/hunger/taurus.cpp

@ -124,7 +124,7 @@ void CWeaponEinarTaurus::TaurusFire( float flSpread, float flCycleTime, BOOL fUs
m_pPlayer->pev->effects = (int)( m_pPlayer->pev->effects ) | EF_MUZZLEFLASH; m_pPlayer->pev->effects = (int)( m_pPlayer->pev->effects ) | EF_MUZZLEFLASH;
int flags; int flags;
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
flags = FEV_NOTHOST; flags = FEV_NOTHOST;
#else #else
flags = 0; flags = 0;

6
dlls/hunger/tfcsniper.cpp

@ -143,7 +143,7 @@ void CWeaponEinarTFCSniper::PrimaryAttack()
Vector vecSrc = m_pPlayer->GetGunPosition(); Vector vecSrc = m_pPlayer->GetGunPosition();
Vector vecAiming = gpGlobals->v_forward; Vector vecAiming = gpGlobals->v_forward;
#ifdef CLIENT_DLL #if CLIENT_DLL
if( bIsMultiplayer() ) if( bIsMultiplayer() )
#else #else
if( g_pGameRules->IsMultiplayer() ) if( g_pGameRules->IsMultiplayer() )
@ -176,7 +176,7 @@ void CWeaponEinarTFCSniper::PrimaryAttack()
Vector vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, Vector( flSpread, flSpread, flSpread ), 8192, BULLET_PLAYER_357, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed ); Vector vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, Vector( flSpread, flSpread, flSpread ), 8192, BULLET_PLAYER_357, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
int flags; int flags;
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
flags = FEV_NOTHOST; flags = FEV_NOTHOST;
#else #else
flags = 0; flags = 0;
@ -215,7 +215,7 @@ void CWeaponEinarTFCSniper::SecondaryAttack()
m_fInZoom = 1; m_fInZoom = 1;
SetBits( iFadeFlags, FFADE_OUT | FFADE_STAYOUT ); SetBits( iFadeFlags, FFADE_OUT | FFADE_STAYOUT );
} }
#ifndef CLIENT_DLL #if !CLIENT_DLL
UTIL_ScreenFade( m_pPlayer, Vector( 0, 255, 0 ), 0.0, 0.0, 70, iFadeFlags ); UTIL_ScreenFade( m_pPlayer, Vector( 0, 255, 0 ), 0.0, 0.0, 70, iFadeFlags );
#endif #endif
pev->nextthink = UTIL_WeaponTimeBase() + 0.11f; pev->nextthink = UTIL_WeaponTimeBase() + 0.11f;

2
dlls/weapons.cpp

@ -381,7 +381,7 @@ void W_Precache( void )
UTIL_PrecacheOtherWeapon( "weapon_th_taurus" ); UTIL_PrecacheOtherWeapon( "weapon_th_taurus" );
UTIL_PrecacheOther( "ammo_th_taurus" ); UTIL_PrecacheOther( "ammo_th_taurus" );
#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) #if !OEM_BUILD && !HLDEMO_BUILD
if( g_pGameRules->IsDeathmatch() ) if( g_pGameRules->IsDeathmatch() )
{ {
UTIL_PrecacheOther( "weaponbox" );// container for dropped deathmatch weapons UTIL_PrecacheOther( "weaponbox" );// container for dropped deathmatch weapons

32
dlls/weapons.h

@ -571,7 +571,7 @@ public:
void Holster( int skiplocal = 0 ); void Holster( int skiplocal = 0 );
void Reload( void ); void Reload( void );
void WeaponIdle( void ); void WeaponIdle( void );
#ifndef CLIENT_DLL #if !CLIENT_DLL
int Save( CSave &save ); int Save( CSave &save );
int Restore( CRestore &restore ); int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
@ -1015,7 +1015,7 @@ public:
int Swing( int fFirst ); int Swing( int fFirst );
BOOL Deploy(); BOOL Deploy();
void Holster( int skiplocal = 0 ); void Holster( int skiplocal = 0 );
#ifdef CROWBAR_IDLE_ANIM #if CROWBAR_IDLE_ANIM
void WeaponIdle(); void WeaponIdle();
#endif #endif
int m_iSwing; int m_iSwing;
@ -1023,7 +1023,7 @@ public:
virtual BOOL UseDecrement() virtual BOOL UseDecrement()
{ {
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
return TRUE; return TRUE;
#else #else
return FALSE; return FALSE;
@ -1046,7 +1046,7 @@ public:
int Swing( int fFirst ); int Swing( int fFirst );
BOOL Deploy(); BOOL Deploy();
void Holster( int skiplocal = 0 ); void Holster( int skiplocal = 0 );
#ifdef CROWBAR_IDLE_ANIM #if CROWBAR_IDLE_ANIM
void WeaponIdle(); void WeaponIdle();
#endif #endif
int m_iSwing; int m_iSwing;
@ -1054,7 +1054,7 @@ public:
virtual BOOL UseDecrement( void ) virtual BOOL UseDecrement( void )
{ {
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
return TRUE; return TRUE;
#else #else
return FALSE; return FALSE;
@ -1065,7 +1065,7 @@ public:
class CWeaponEinarAP9 : public CBasePlayerWeapon class CWeaponEinarAP9 : public CBasePlayerWeapon
{ {
public: public:
#ifndef CLIENT_DLL #if !CLIENT_DLL
int Save( CSave &save ); int Save( CSave &save );
int Restore( CRestore &restore ); int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
@ -1087,7 +1087,7 @@ public:
virtual BOOL UseDecrement() virtual BOOL UseDecrement()
{ {
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
return TRUE; return TRUE;
#else #else
return FALSE; return FALSE;
@ -1115,7 +1115,7 @@ public:
virtual BOOL UseDecrement() virtual BOOL UseDecrement()
{ {
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
return TRUE; return TRUE;
#else #else
return FALSE; return FALSE;
@ -1130,7 +1130,7 @@ private:
class CWeaponEinarSniper : public CBasePlayerWeapon class CWeaponEinarSniper : public CBasePlayerWeapon
{ {
public: public:
#ifndef CLIENT_DLL #if !CLIENT_DLL
int Save( CSave &save ); int Save( CSave &save );
int Restore( CRestore &restore ); int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
@ -1149,7 +1149,7 @@ public:
virtual BOOL UseDecrement() virtual BOOL UseDecrement()
{ {
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
return TRUE; return TRUE;
#else #else
return FALSE; return FALSE;
@ -1163,7 +1163,7 @@ private:
class CWeaponEinarTFCSniper : public CBasePlayerWeapon class CWeaponEinarTFCSniper : public CBasePlayerWeapon
{ {
public: public:
#ifndef CLIENT_DLL #if !CLIENT_DLL
int Save( CSave &save ); int Save( CSave &save );
int Restore( CRestore &restore ); int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
@ -1182,7 +1182,7 @@ public:
virtual BOOL UseDecrement() virtual BOOL UseDecrement()
{ {
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
return TRUE; return TRUE;
#else #else
return FALSE; return FALSE;
@ -1196,7 +1196,7 @@ private:
class CWeaponEinarChaingun : public CBasePlayerWeapon class CWeaponEinarChaingun : public CBasePlayerWeapon
{ {
public: public:
#ifndef CLIENT_DLL #if !CLIENT_DLL
int Save( CSave &save ); int Save( CSave &save );
int Restore( CRestore &restore ); int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
@ -1216,7 +1216,7 @@ public:
virtual BOOL UseDecrement() virtual BOOL UseDecrement()
{ {
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
return TRUE; return TRUE;
#else #else
return FALSE; return FALSE;
@ -1238,7 +1238,7 @@ private:
class CWeaponEinarMedkit : public CBasePlayerWeapon class CWeaponEinarMedkit : public CBasePlayerWeapon
{ {
public: public:
#ifndef CLIENT_DLL #if !CLIENT_DLL
int Save( CSave &save ); int Save( CSave &save );
int Restore( CRestore &restore ); int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
@ -1261,7 +1261,7 @@ public:
virtual BOOL UseDecrement() virtual BOOL UseDecrement()
{ {
#if defined( CLIENT_WEAPONS ) #if CLIENT_WEAPONS
return TRUE; return TRUE;
#else #else
return FALSE; return FALSE;

Loading…
Cancel
Save