Browse Source

Double promotion fixes.

theyhunger
Andrey Akhmichin 5 years ago
parent
commit
b8f49f3bfd
  1. 4
      cl_dll/ev_hldm.cpp
  2. 2
      dlls/crossbow.cpp
  3. 2
      dlls/crowbar.cpp
  4. 2
      dlls/egon.cpp
  5. 4
      dlls/handgrenade.cpp
  6. 2
      dlls/houndeye.cpp
  7. 12
      dlls/hunger/ap9.cpp
  8. 4
      dlls/hunger/boss.cpp
  9. 20
      dlls/hunger/chaingun.cpp
  10. 2
      dlls/hunger/civilian.cpp
  11. 2
      dlls/hunger/cyberfranklin.cpp
  12. 6
      dlls/hunger/flame.cpp
  13. 10
      dlls/hunger/medkit.cpp
  14. 8
      dlls/hunger/megasquid.cpp
  15. 40
      dlls/hunger/shovel.cpp
  16. 28
      dlls/hunger/sniper.cpp
  17. 26
      dlls/hunger/spanner.cpp
  18. 8
      dlls/hunger/taurus.cpp
  19. 28
      dlls/hunger/tfcsniper.cpp
  20. 6
      dlls/hunger/zombiebull.cpp
  21. 2
      dlls/tripmine.cpp

4
cl_dll/ev_hldm.cpp

@ -1109,9 +1109,9 @@ void EV_TrainPitchAdjust( event_args_t *args )
us_params = (unsigned short)args->iparam1; us_params = (unsigned short)args->iparam1;
stop = args->bparam1; stop = args->bparam1;
m_flVolume = (float)( us_params & 0x003f ) / 40.0; m_flVolume = (float)( us_params & 0x003f ) / 40.0f;
noise = (int)( ( ( us_params ) >> 12 ) & 0x0007 ); noise = (int)( ( ( us_params ) >> 12 ) & 0x0007 );
pitch = (int)( 10.0 * (float)( ( us_params >> 6 ) & 0x003f ) ); pitch = (int)( 10.0f * (float)( ( us_params >> 6 ) & 0x003f ) );
switch( noise ) switch( noise )
{ {

2
dlls/crossbow.cpp

@ -420,7 +420,7 @@ void CCrossbow::FireSniperBolt()
if( FClassnameIs( tr.pHit, "worldspawn" ) ) if( FClassnameIs( tr.pHit, "worldspawn" ) )
{ {
// let the bolt sit around for a while if it hit static architecture // let the bolt sit around for a while if it hit static architecture
pBolt->pev->nextthink = gpGlobals->time + 5.0; pBolt->pev->nextthink = gpGlobals->time + 5.0f;
} }
else else
{ {

2
dlls/crowbar.cpp

@ -220,7 +220,7 @@ int CCrowbar::Swing( int fFirst )
SendWeaponAnim( CROWBAR_ATTACK3MISS ); SendWeaponAnim( CROWBAR_ATTACK3MISS );
break; break;
} }
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f;
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 #ifdef 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 );

2
dlls/egon.cpp

@ -195,7 +195,7 @@ void CEgon::PrimaryAttack( void )
m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 );
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2f; m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f;
} }
void CEgon::WeaponIdle( void ) void CEgon::WeaponIdle( void )

4
dlls/handgrenade.cpp

@ -245,8 +245,8 @@ CGrenade *CHandGrenade::ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector
pGrenade->pev->dmgtime = gpGlobals->time + time; pGrenade->pev->dmgtime = gpGlobals->time + time;
pGrenade->SetThink( &CGrenade::TumbleThink ); pGrenade->SetThink( &CGrenade::TumbleThink );
pGrenade->pev->nextthink = gpGlobals->time + 0.1; pGrenade->pev->nextthink = gpGlobals->time + 0.1f;
if( time < 0.1 ) if( time < 0.1f )
{ {
pGrenade->pev->nextthink = gpGlobals->time; pGrenade->pev->nextthink = gpGlobals->time;
pGrenade->pev->velocity = Vector( 0, 0, 0 ); pGrenade->pev->velocity = Vector( 0, 0, 0 );

2
dlls/houndeye.cpp

@ -421,7 +421,7 @@ void CHoundeye::WarmUpSound( void )
{ {
Vector vecMouthPos, vecMouthAng; Vector vecMouthPos, vecMouthAng;
CBaseEntity *pHurt = 0; CBaseEntity *pHurt = 0;
pHurt = CheckTraceHullAttack( 80, gSkillData.houndeyeDmgBlast * 0.4, DMG_SLASH ); pHurt = CheckTraceHullAttack( 80, gSkillData.houndeyeDmgBlast * 0.4f, DMG_SLASH );
if( pHurt ) if( pHurt )
{ {

12
dlls/hunger/ap9.cpp

@ -103,13 +103,13 @@ BOOL CWeaponEinarAP9::Deploy()
void CWeaponEinarAP9::SecondaryAttack() void CWeaponEinarAP9::SecondaryAttack()
{ {
m_iBurstShots += 2; m_iBurstShots += 2;
AP9Fire( 0.035, 0.6, FALSE ); AP9Fire( 0.035f, 0.6f, FALSE );
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.04; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.04f;
} }
void CWeaponEinarAP9::PrimaryAttack() void CWeaponEinarAP9::PrimaryAttack()
{ {
AP9Fire( 0.07, 0.125, TRUE ); AP9Fire( 0.07f, 0.125f, TRUE );
} }
void CWeaponEinarAP9::AP9Fire( float flSpread, float flCycleTime, BOOL fUseAutoAim ) void CWeaponEinarAP9::AP9Fire( float flSpread, float flCycleTime, BOOL fUseAutoAim )
@ -121,7 +121,7 @@ void CWeaponEinarAP9::AP9Fire( float flSpread, float flCycleTime, BOOL fUseAutoA
if( m_fFireOnEmpty ) if( m_fFireOnEmpty )
{ {
PlayEmptySound(); PlayEmptySound();
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2; m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2f;
} }
return; return;
} }
@ -189,7 +189,7 @@ void CWeaponEinarAP9::Reload()
#else #else
if( !g_pGameRules->IsMultiplayer() ) if( !g_pGameRules->IsMultiplayer() )
#endif #endif
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.9; m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.9f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
} }
} }
@ -216,7 +216,7 @@ void CWeaponEinarAP9::WeaponIdle()
{ {
SendWeaponAnim( AP9_IDLE ); SendWeaponAnim( AP9_IDLE );
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; // how long till we do this again. m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; // how long till we do this again.
} }
} }

4
dlls/hunger/boss.cpp

@ -42,7 +42,7 @@ void CEinarBoss::Spawn()
pev->model = MAKE_STRING( "models/boss.mdl" ); pev->model = MAKE_STRING( "models/boss.mdl" );
if( !pev->health ) if( !pev->health )
pev->health = gSkillData.apacheHealth * 2; pev->health = gSkillData.apacheHealth * 2.0f;
CApache::Spawn(); CApache::Spawn();
} }
@ -98,7 +98,7 @@ BOOL CEinarBoss::FireGun()
GetAttachment( 0, posBarrel, angBarrel ); GetAttachment( 0, posBarrel, angBarrel );
Vector vecGun = (posBarrel - posGun).Normalize(); Vector vecGun = (posBarrel - posGun).Normalize();
if( DotProduct( vecGun, vecTarget ) > 0.98 && !( ( ++m_iShots ) % 3 ) ) if( DotProduct( vecGun, vecTarget ) > 0.98f && !( ( ++m_iShots ) % 3 ) )
{ {
FireBullets( 1, posGun, vecGun, VECTOR_CONE_4DEGREES, 8192, BULLET_MONSTER_9MM, 1 ); FireBullets( 1, posGun, vecGun, VECTOR_CONE_4DEGREES, 8192, BULLET_MONSTER_9MM, 1 );
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "turret/tu_fire1.wav", 1, 0.3 ); EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "turret/tu_fire1.wav", 1, 0.3 );

20
dlls/hunger/chaingun.cpp

@ -100,7 +100,7 @@ void CWeaponEinarChaingun::Holster( int skiplocal /*= 0*/ )
SpinDown(); SpinDown();
else else
SendWeaponAnim( CHAINGUN_HOLSTER ); SendWeaponAnim( CHAINGUN_HOLSTER );
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
} }
void CWeaponEinarChaingun::PrimaryAttack() void CWeaponEinarChaingun::PrimaryAttack()
@ -116,7 +116,7 @@ void CWeaponEinarChaingun::PrimaryAttack()
else else
{ {
PlayEmptySound(); PlayEmptySound();
m_flNextSecondaryAttack = m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2; m_flNextSecondaryAttack = m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2f;
} }
return; return;
} }
@ -163,8 +163,8 @@ void CWeaponEinarChaingun::SpinUp()
PLAYBACK_EVENT_FULL( 0, m_pPlayer->edict(), m_usFireChaingun1, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, TRUE, 0 ); PLAYBACK_EVENT_FULL( 0, m_pPlayer->edict(), m_usFireChaingun1, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, TRUE, 0 );
m_fInAttack = 1; m_fInAttack = 1;
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4; m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f;
} }
@ -173,10 +173,10 @@ void CWeaponEinarChaingun::SpinDown()
// Restore player speed. // Restore player speed.
PLAYBACK_EVENT_FULL( 0, m_pPlayer->edict(), m_usFireChaingun1, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, FALSE, 0 ); PLAYBACK_EVENT_FULL( 0, m_pPlayer->edict(), m_usFireChaingun1, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, FALSE, 0 );
m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.2; m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.2f;
m_fInAttack = 0; m_fInAttack = 0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f;
} }
void CWeaponEinarChaingun::Fire( float flSpread, float flCycleTime, BOOL fUseAutoAim ) void CWeaponEinarChaingun::Fire( float flSpread, float flCycleTime, BOOL fUseAutoAim )
@ -208,7 +208,7 @@ void CWeaponEinarChaingun::Fire( float flSpread, float flCycleTime, BOOL fUseAut
// HEV suit - indicate out of ammo condition // HEV suit - indicate out of ammo condition
m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 );
m_flTimeWeaponIdle = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.1; m_flTimeWeaponIdle = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.1f;
} }
void CWeaponEinarChaingun::Reload() void CWeaponEinarChaingun::Reload()
@ -225,7 +225,7 @@ void CWeaponEinarChaingun::Reload()
{ {
m_fInSpecialReload = 2; m_fInSpecialReload = 2;
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.0; m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.0f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 5, 10 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 5, 10 );
} }
} }
@ -244,7 +244,7 @@ void CWeaponEinarChaingun::WeaponIdle()
else if( m_fInSpecialReload == 2 ) else if( m_fInSpecialReload == 2 )
{ {
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/reload3.wav", 1, ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0x1f ) ); EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/reload3.wav", 1, ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0x1f ) );
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f;
m_fInSpecialReload = 3; m_fInSpecialReload = 3;
} }
} }
@ -261,7 +261,7 @@ void CWeaponEinarChaingun::WeaponIdle()
{ {
int iAnim; int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
if( flRand <= 0.5 ) if( flRand <= 0.5f )
{ {
iAnim = CHAINGUN_IDLE; iAnim = CHAINGUN_IDLE;
} }

2
dlls/hunger/civilian.cpp

@ -177,7 +177,7 @@ void CEinarSittingCivilian::Spawn()
ResetSequenceInfo(); ResetSequenceInfo();
SetThink( &CEinarSittingCivilian::SittingThink ); SetThink( &CEinarSittingCivilian::SittingThink );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1f;
DROP_TO_FLOOR( ENT( pev ) ); DROP_TO_FLOOR( ENT( pev ) );
} }

2
dlls/hunger/cyberfranklin.cpp

@ -120,7 +120,7 @@ void CEinarCyberFranklin::PainSound()
if( m_flNextPainTime > gpGlobals->time ) if( m_flNextPainTime > gpGlobals->time )
return; return;
m_flNextPainTime = gpGlobals->time + 2.0; m_flNextPainTime = gpGlobals->time + 2.0f;
EMIT_SOUND( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pPainSounds ), 1.0, ATTN_NORM ); EMIT_SOUND( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pPainSounds ), 1.0, ATTN_NORM );
} }

6
dlls/hunger/flame.cpp

@ -60,7 +60,7 @@ void CEinarFlameRocket::Spawn()
SetTouch( &CEinarFlameRocket::FlameTouch ); SetTouch( &CEinarFlameRocket::FlameTouch );
SetThink( &CBaseEntity::SUB_Remove ); SetThink( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time + 1.1; pev->nextthink = gpGlobals->time + 1.1f;
UTIL_MakeVectors( pev->angles ); UTIL_MakeVectors( pev->angles );
pev->velocity = gpGlobals->v_forward * pev->speed; pev->velocity = gpGlobals->v_forward * pev->speed;
@ -97,8 +97,8 @@ void CEinarFlameRocket::FlameTouch( CBaseEntity *pOther )
pevOwner = 0; pevOwner = 0;
} }
pev->dmg = g_pGameRules->IsMultiplayer() ? gSkillData.plrDmgEgonWide : ( gSkillData.plrDmgEgonNarrow * 1.5 ); pev->dmg = g_pGameRules->IsMultiplayer() ? gSkillData.plrDmgEgonWide : ( gSkillData.plrDmgEgonNarrow * 1.5f );
pev->dmg *= 2; pev->dmg *= 2.0f;
ClearMultiDamage(); ClearMultiDamage();
pOther->TraceAttack(pevOwner, pev->dmg, pev->velocity.Normalize(), &tr, DMG_BURN ); pOther->TraceAttack(pevOwner, pev->dmg, pev->velocity.Normalize(), &tr, DMG_BURN );

10
dlls/hunger/medkit.cpp

@ -80,7 +80,7 @@ BOOL CWeaponEinarMedkit::Deploy()
void CWeaponEinarMedkit::Holster(int skiplocal /*= 0*/) void CWeaponEinarMedkit::Holster(int skiplocal /*= 0*/)
{ {
m_fInAttack = 0; m_fInAttack = 0;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
SendWeaponAnim( MEDKIT_HOLSTER ); SendWeaponAnim( MEDKIT_HOLSTER );
} }
@ -92,7 +92,7 @@ void CWeaponEinarMedkit::PrimaryAttack()
if( m_fFireOnEmpty ) if( m_fFireOnEmpty )
{ {
PlayEmptySound(); PlayEmptySound();
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f;
} }
return; return;
} }
@ -117,7 +117,7 @@ void CWeaponEinarMedkit::Use()
{ {
SendWeaponAnim( MEDKIT_LONGUSE, 0 ); SendWeaponAnim( MEDKIT_LONGUSE, 0 );
m_fInAttack = 1; m_fInAttack = 1;
m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.2; m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.2f;
} }
void CWeaponEinarMedkit::Heal() void CWeaponEinarMedkit::Heal()
@ -134,7 +134,7 @@ void CWeaponEinarMedkit::Heal()
m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 );
m_fInAttack = 0; m_fInAttack = 0;
m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.2; m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.2f;
} }
void CWeaponEinarMedkit::Reload() void CWeaponEinarMedkit::Reload()
@ -156,7 +156,7 @@ void CWeaponEinarMedkit::WeaponIdle()
} }
SendWeaponAnim( MEDKIT_IDLE, 0 ); SendWeaponAnim( MEDKIT_IDLE, 0 );
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f;
} }
BOOL CWeaponEinarMedkit::PlayEmptySound() BOOL CWeaponEinarMedkit::PlayEmptySound()

8
dlls/hunger/megasquid.cpp

@ -110,7 +110,7 @@ void CEinarMegasquid::Precache()
//========================================================= //=========================================================
BOOL CEinarMegasquid::CheckRangeAttack1( float flDot, float flDist ) BOOL CEinarMegasquid::CheckRangeAttack1( float flDot, float flDist )
{ {
if( flDist > 450 && flDist <= 1256 && flDot >= 0.5 && gpGlobals->time >= m_flNextSpitTime ) if( flDist > 450 && flDist <= 1256 && flDot >= 0.5f && gpGlobals->time >= m_flNextSpitTime )
{ {
if( m_hEnemy != 0 ) if( m_hEnemy != 0 )
{ {
@ -124,12 +124,12 @@ BOOL CEinarMegasquid::CheckRangeAttack1( float flDot, float flDist )
if( IsMoving() ) if( IsMoving() )
{ {
// don't spit again for a long time, resume chasing enemy. // don't spit again for a long time, resume chasing enemy.
m_flNextSpitTime = gpGlobals->time + 5; m_flNextSpitTime = gpGlobals->time + 5.0f;
} }
else else
{ {
// not moving, so spit again pretty soon. // not moving, so spit again pretty soon.
m_flNextSpitTime = gpGlobals->time + 0.5; m_flNextSpitTime = gpGlobals->time + 0.5f;
} }
return TRUE; return TRUE;
@ -146,7 +146,7 @@ BOOL CEinarMegasquid::CheckRangeAttack1( float flDot, float flDist )
//========================================================= //=========================================================
BOOL CEinarMegasquid::CheckMeleeAttack2( float flDot, float flDist ) BOOL CEinarMegasquid::CheckMeleeAttack2( float flDot, float flDist )
{ {
if( flDist <= 330 && flDot >= 0.7 ) // The player & bullsquid can be as much as their bboxes if( flDist <= 330 && flDot >= 0.7f ) // The player & bullsquid can be as much as their bboxes
{ // apart (48 * sqrt(3)) and he can still attack (85 is a little more than 48*sqrt(3)) { // apart (48 * sqrt(3)) and he can still attack (85 is a little more than 48*sqrt(3))
return TRUE; return TRUE;
} }

40
dlls/hunger/shovel.cpp

@ -107,7 +107,7 @@ BOOL CWeaponEinarShovel::Deploy()
void CWeaponEinarShovel::Holster( int skiplocal /* = 0 */ ) void CWeaponEinarShovel::Holster( int skiplocal /* = 0 */ )
{ {
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
SendWeaponAnim( SHOVEL_HOLSTER ); SendWeaponAnim( SHOVEL_HOLSTER );
} }
@ -116,7 +116,7 @@ void CWeaponEinarShovel::PrimaryAttack()
if( !Swing( 1 ) ) if( !Swing( 1 ) )
{ {
SetThink( &CWeaponEinarShovel::SwingAgain ); SetThink( &CWeaponEinarShovel::SwingAgain );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1f;
} }
} }
@ -143,10 +143,10 @@ 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 #ifndef CLIENT_DLL
if( tr.flFraction >= 1.0 ) 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 );
if( tr.flFraction < 1.0 ) if( tr.flFraction < 1.0f )
{ {
// Calculate the point of intersection of the line (or hull) and the object we hit // Calculate the point of intersection of the line (or hull) and the object we hit
// This is and approximation of the "best" intersection // This is and approximation of the "best" intersection
@ -157,12 +157,12 @@ int CWeaponEinarShovel::Swing( int fFirst )
} }
} }
#endif #endif
if( tr.flFraction >= 1.0 ) if( tr.flFraction >= 1.0f )
{ {
if( fFirst ) if( fFirst )
{ {
// miss // miss
if( RANDOM_FLOAT( 0.0, 1.0 ) <= 0.25 ) if( RANDOM_FLOAT( 0.0f, 1.0f ) <= 0.25f )
++m_iSwing; ++m_iSwing;
switch( ( m_iSwing++ ) % 2 ) switch( ( m_iSwing++ ) % 2 )
{ {
@ -176,7 +176,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
SendWeaponAnim( SHOVEL_ATTACK3MISS ); SendWeaponAnim( SHOVEL_ATTACK3MISS );
break;*/ break;*/
} }
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f;
// player "shoot" animation // player "shoot" animation
m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
@ -211,7 +211,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit );
// play thwack, smack, or dong sound // play thwack, smack, or dong sound
float flVol = 1.0; float flVol = 1.0f;
int fHitWorld = TRUE; int fHitWorld = TRUE;
if( pEntity ) if( pEntity )
@ -222,17 +222,17 @@ int CWeaponEinarShovel::Swing( int fFirst )
if( g_pGameRules->IsMultiplayer() ) if( g_pGameRules->IsMultiplayer() )
{ {
// more damage in multiplayer // more damage in multiplayer
flDmg = gSkillData.plrDmgCrowbar * 1.6; flDmg = gSkillData.plrDmgCrowbar * 1.6f;
} }
else if( m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() ) else if( m_flNextPrimaryAttack + 1.0f < UTIL_WeaponTimeBase() )
{ {
// first swing does full damage // first swing does full damage
flDmg = gSkillData.plrDmgCrowbar * 1.2; flDmg = gSkillData.plrDmgCrowbar * 1.2f;
} }
else else
{ {
// subsequent swings do half // subsequent swings do half
flDmg = gSkillData.plrDmgCrowbar * 0.6; flDmg = gSkillData.plrDmgCrowbar * 0.6f;
} }
pEntity->TraceAttack( m_pPlayer->pev, flDmg, gpGlobals->v_forward, &tr, DMG_CLUB ); pEntity->TraceAttack( m_pPlayer->pev, flDmg, gpGlobals->v_forward, &tr, DMG_CLUB );
ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev );
@ -277,7 +277,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
if( !pEntity->IsAlive() ) if( !pEntity->IsAlive() )
return TRUE; return TRUE;
else else
flVol = 0.1; flVol = 0.1f;
fHitWorld = FALSE; fHitWorld = FALSE;
} }
@ -315,10 +315,10 @@ int CWeaponEinarShovel::Swing( int fFirst )
m_pPlayer->m_iWeaponVolume = flVol * SHOVEL_WALLHIT_VOLUME; m_pPlayer->m_iWeaponVolume = flVol * SHOVEL_WALLHIT_VOLUME;
#endif #endif
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f;
SetThink( &CWeaponEinarShovel::Smack ); SetThink( &CWeaponEinarShovel::Smack );
pev->nextthink = UTIL_WeaponTimeBase() + 0.2; pev->nextthink = UTIL_WeaponTimeBase() + 0.2f;
} }
#ifdef CROWBAR_IDLE_ANIM #ifdef 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 );
@ -333,22 +333,22 @@ void CWeaponEinarShovel::WeaponIdle( void )
{ {
int iAnim; int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
if( flRand > 0.9 ) if( flRand > 0.9f )
{ {
iAnim = SHOVEL_IDLE2; iAnim = SHOVEL_IDLE2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f;
} }
else else
{ {
if( flRand > 0.5 ) if( flRand > 0.5f )
{ {
iAnim = SHOVEL_IDLE; iAnim = SHOVEL_IDLE;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 30.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f;
} }
else else
{ {
iAnim = SHOVEL_IDLE3; iAnim = SHOVEL_IDLE3;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f;
} }
} }
SendWeaponAnim( iAnim ); SendWeaponAnim( iAnim );

28
dlls/hunger/sniper.cpp

@ -51,7 +51,7 @@ void CWeaponEinarSniper::Holster( int skiplocal /* = 0 */ )
if( m_fInZoom ) if( m_fInZoom )
SecondaryAttack(); SecondaryAttack();
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
} }
int CWeaponEinarSniper::GetItemInfo( ItemInfo *p ) int CWeaponEinarSniper::GetItemInfo( ItemInfo *p )
@ -122,8 +122,8 @@ void CWeaponEinarSniper::SecondaryAttack()
#ifndef CLIENT_DLL #ifndef 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.11; pev->nextthink = UTIL_WeaponTimeBase() + 0.11f;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75; m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75f;
} }
void CWeaponEinarSniper::PrimaryAttack() void CWeaponEinarSniper::PrimaryAttack()
@ -137,7 +137,7 @@ void CWeaponEinarSniper::PrimaryAttack()
if( m_fFireOnEmpty ) if( m_fFireOnEmpty )
{ {
PlayEmptySound(); PlayEmptySound();
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f;
} }
if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() )
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 15, 20 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 15, 20 );
@ -167,12 +167,12 @@ void CWeaponEinarSniper::PrimaryAttack()
{ {
if( m_fInZoom ) if( m_fInZoom )
{ {
flSpread = 0.002; flSpread = 0.002f;
iDmg = 80; iDmg = 80;
} }
else else
{ {
flSpread = 0.07846; flSpread = 0.07846f;
iDmg = 40; iDmg = 40;
} }
} }
@ -180,11 +180,11 @@ void CWeaponEinarSniper::PrimaryAttack()
{ {
if( m_fInZoom ) if( m_fInZoom )
{ {
flSpread = 0.004; flSpread = 0.004f;
} }
else else
{ {
flSpread = 0.08716; flSpread = 0.08716f;
} }
iDmg = 0; iDmg = 0;
} }
@ -206,13 +206,13 @@ void CWeaponEinarSniper::PrimaryAttack()
if( m_fInZoom ) if( m_fInZoom )
{ {
m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f;
} }
else else
{ {
m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.11; m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.11f;
m_pPlayer->pev->punchangle.x -= ( RANDOM_FLOAT( 0, 2.0 ) + 4.0 ); m_pPlayer->pev->punchangle.x -= ( RANDOM_FLOAT( 0.0f, 2.0f ) + 4.0f );
m_pPlayer->pev->punchangle.y -= ( 1.0 - RANDOM_FLOAT( 0, 2.0 ) ); m_pPlayer->pev->punchangle.y -= ( 1.0f - RANDOM_FLOAT( 0.0f, 2.0f ) );
} }
} }
@ -224,13 +224,13 @@ void CWeaponEinarSniper::Reload()
if( m_fInZoom ) if( m_fInZoom )
SecondaryAttack(); SecondaryAttack();
int iResult = DefaultReload( SNIPER_MAX_CLIP, SNIPER_RELOAD, 3.3 ); int iResult = DefaultReload( SNIPER_MAX_CLIP, SNIPER_RELOAD, 3.3f );
} }
void CWeaponEinarSniper::WeaponIdle() void CWeaponEinarSniper::WeaponIdle()
{ {
ResetEmptySound(); ResetEmptySound();
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f;
} }
class CSniperAmmo : public CBasePlayerAmmo class CSniperAmmo : public CBasePlayerAmmo

26
dlls/hunger/spanner.cpp

@ -102,7 +102,7 @@ BOOL CWeaponEinarSpanner::Deploy()
void CWeaponEinarSpanner::Holster(int skiplocal /* = 0 */) void CWeaponEinarSpanner::Holster(int skiplocal /* = 0 */)
{ {
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
SendWeaponAnim( SPANNER_HOLSTER ); SendWeaponAnim( SPANNER_HOLSTER );
} }
@ -111,7 +111,7 @@ void CWeaponEinarSpanner::PrimaryAttack()
if( !Swing( 1 ) ) if( !Swing( 1 ) )
{ {
SetThink( &CWeaponEinarSpanner::SwingAgain ); SetThink( &CWeaponEinarSpanner::SwingAgain );
pev->nextthink = gpGlobals->time + 0.1; pev->nextthink = gpGlobals->time + 0.1f;
} }
} }
@ -138,10 +138,10 @@ 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 #ifndef CLIENT_DLL
if( tr.flFraction >= 1.0 ) 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 );
if( tr.flFraction < 1.0 ) if( tr.flFraction < 1.0f )
{ {
// Calculate the point of intersection of the line (or hull) and the object we hit // Calculate the point of intersection of the line (or hull) and the object we hit
// This is and approximation of the "best" intersection // This is and approximation of the "best" intersection
@ -152,12 +152,12 @@ int CWeaponEinarSpanner::Swing( int fFirst )
} }
} }
#endif #endif
if( tr.flFraction >= 1.0 ) if( tr.flFraction >= 1.0f )
{ {
if( fFirst ) if( fFirst )
{ {
// miss // miss
if( RANDOM_FLOAT( 0.0, 1.0 ) <= 0.25 ) if( RANDOM_FLOAT( 0.0f, 1.0f ) <= 0.25f )
++m_iSwing; ++m_iSwing;
switch( ( m_iSwing++ ) % 2 ) switch( ( m_iSwing++ ) % 2 )
{ {
@ -168,7 +168,7 @@ int CWeaponEinarSpanner::Swing( int fFirst )
SendWeaponAnim( SPANNER_ATTACK2 ); SendWeaponAnim( SPANNER_ATTACK2 );
break; break;
} }
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.4; 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 #ifdef CROWBAR_IDLE_ANIM
@ -209,17 +209,17 @@ int CWeaponEinarSpanner::Swing( int fFirst )
if( g_pGameRules->IsMultiplayer() ) if( g_pGameRules->IsMultiplayer() )
{ {
// more damage in multiplayer // more damage in multiplayer
flDmg = gSkillData.plrDmgCrowbar * 1.2; flDmg = gSkillData.plrDmgCrowbar * 1.2f;
} }
else if( m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() ) else if( m_flNextPrimaryAttack + 1.0f < UTIL_WeaponTimeBase() )
{ {
// first swing does full damage // first swing does full damage
flDmg = gSkillData.plrDmgCrowbar * 0.8; flDmg = gSkillData.plrDmgCrowbar * 0.8f;
} }
else else
{ {
// subsequent swings do half // subsequent swings do half
flDmg = gSkillData.plrDmgCrowbar * 0.4; flDmg = gSkillData.plrDmgCrowbar * 0.4f;
} }
pEntity->TraceAttack( m_pPlayer->pev, flDmg, gpGlobals->v_forward, &tr, DMG_CLUB ); pEntity->TraceAttack( m_pPlayer->pev, flDmg, gpGlobals->v_forward, &tr, DMG_CLUB );
ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev );
@ -301,10 +301,10 @@ int CWeaponEinarSpanner::Swing( int fFirst )
m_pPlayer->m_iWeaponVolume = flVol * SPANNER_WALLHIT_VOLUME; m_pPlayer->m_iWeaponVolume = flVol * SPANNER_WALLHIT_VOLUME;
#endif #endif
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2f;
SetThink( &CWeaponEinarSpanner::Smack ); SetThink( &CWeaponEinarSpanner::Smack );
pev->nextthink = UTIL_WeaponTimeBase() + 0.2; pev->nextthink = UTIL_WeaponTimeBase() + 0.2f;
} }
#ifdef CROWBAR_IDLE_ANIM #ifdef 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 );

8
dlls/hunger/taurus.cpp

@ -114,7 +114,7 @@ void CWeaponEinarTaurus::TaurusFire( float flSpread, float flCycleTime, BOOL fUs
if( m_fFireOnEmpty ) if( m_fFireOnEmpty )
{ {
PlayEmptySound(); PlayEmptySound();
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2f;
} }
return; return;
} }
@ -178,11 +178,11 @@ void CWeaponEinarTaurus::WeaponIdle()
int iAnim; int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0, 1.0 ); float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0, 1.0 );
if( flRand <= 0.3 ) if( flRand <= 0.3f )
{ {
iAnim = TAURUS_IDLE3; iAnim = TAURUS_IDLE3;
} }
else if( flRand <= 0.6 ) else if( flRand <= 0.6f )
{ {
iAnim = TAURUS_IDLE1; iAnim = TAURUS_IDLE1;
} }
@ -190,7 +190,7 @@ void CWeaponEinarTaurus::WeaponIdle()
{ {
iAnim = TAURUS_IDLE2; iAnim = TAURUS_IDLE2;
} }
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 15.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 15.0f;
SendWeaponAnim( iAnim, 1 ); SendWeaponAnim( iAnim, 1 );
} }
} }

28
dlls/hunger/tfcsniper.cpp

@ -104,7 +104,7 @@ void CWeaponEinarTFCSniper::Holster( int skiplocal /* = 0 */ )
SecondaryAttack(); SecondaryAttack();
} }
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
} }
void CWeaponEinarTFCSniper::PrimaryAttack() void CWeaponEinarTFCSniper::PrimaryAttack()
@ -118,7 +118,7 @@ void CWeaponEinarTFCSniper::PrimaryAttack()
if( m_fFireOnEmpty ) if( m_fFireOnEmpty )
{ {
PlayEmptySound(); PlayEmptySound();
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f;
} }
if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() )
{ {
@ -151,12 +151,12 @@ void CWeaponEinarTFCSniper::PrimaryAttack()
{ {
if( m_fInZoom ) if( m_fInZoom )
{ {
flSpread = 0.002; flSpread = 0.002f;
iDmg = 80; iDmg = 80;
} }
else else
{ {
flSpread = 0.07846; flSpread = 0.07846f;
iDmg = 40; iDmg = 40;
} }
} }
@ -164,11 +164,11 @@ void CWeaponEinarTFCSniper::PrimaryAttack()
{ {
if( m_fInZoom ) if( m_fInZoom )
{ {
flSpread = 0.004; flSpread = 0.004f;
} }
else else
{ {
flSpread = 0.08716; flSpread = 0.08716f;
} }
iDmg = 0; iDmg = 0;
} }
@ -190,13 +190,13 @@ void CWeaponEinarTFCSniper::PrimaryAttack()
if( m_fInZoom ) if( m_fInZoom )
{ {
m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f;
} }
else else
{ {
m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.11; m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.11f;
m_pPlayer->pev->punchangle.x -= ( RANDOM_FLOAT( 0, 2.0 ) + 4.0 ); m_pPlayer->pev->punchangle.x -= ( RANDOM_FLOAT( 0.0f, 2.0f ) + 4.0f );
m_pPlayer->pev->punchangle.y -= ( 1.0 - RANDOM_FLOAT( 0, 2.0 ) ); m_pPlayer->pev->punchangle.y -= ( 1.0f - RANDOM_FLOAT( 0.0f, 2.0f ) );
} }
} }
@ -218,8 +218,8 @@ void CWeaponEinarTFCSniper::SecondaryAttack()
#ifndef CLIENT_DLL #ifndef 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.11; pev->nextthink = UTIL_WeaponTimeBase() + 0.11f;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75; m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75f;
} }
void CWeaponEinarTFCSniper::Reload() void CWeaponEinarTFCSniper::Reload()
@ -233,7 +233,7 @@ void CWeaponEinarTFCSniper::Reload()
if( DefaultReload( SNIPER_MAX_CLIP, TFCSNIPER_AUTOHOLSTER, 0.5 ) ) if( DefaultReload( SNIPER_MAX_CLIP, TFCSNIPER_AUTOHOLSTER, 0.5 ) )
{ {
m_fInSpecialReload = 2; m_fInSpecialReload = 2;
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.0; m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.0f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 5, 10 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 5, 10 );
} }
} }
@ -251,7 +251,7 @@ void CWeaponEinarTFCSniper::WeaponIdle()
if( m_fInSpecialReload == 2 ) if( m_fInSpecialReload == 2 )
{ {
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/reload3.wav", RANDOM_FLOAT( 0.8, 0.9 ), ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0x1f ) ); EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/reload3.wav", RANDOM_FLOAT( 0.8, 0.9 ), ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0x1f ) );
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f;
m_fInSpecialReload = 3; m_fInSpecialReload = 3;
} }
if( m_flTimeWeaponIdle <= UTIL_WeaponTimeBase() ) if( m_flTimeWeaponIdle <= UTIL_WeaponTimeBase() )

6
dlls/hunger/zombiebull.cpp

@ -173,7 +173,7 @@ int CEinarZombieBull::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke
{ {
flDist = ( pev->origin - m_Route[m_iRouteIndex].vecLocation ).Length2D();// reusing flDist. flDist = ( pev->origin - m_Route[m_iRouteIndex].vecLocation ).Length2D();// reusing flDist.
if( FTriangulate( pev->origin, m_Route[m_iRouteIndex].vecLocation, flDist * 0.5, m_hEnemy, &vecApex ) ) if( FTriangulate( pev->origin, m_Route[m_iRouteIndex].vecLocation, flDist * 0.5f, m_hEnemy, &vecApex ) )
{ {
InsertWaypoint( vecApex, bits_MF_TO_DETOUR | bits_MF_DONT_SIMPLIFY ); InsertWaypoint( vecApex, bits_MF_TO_DETOUR | bits_MF_DONT_SIMPLIFY );
} }
@ -191,7 +191,7 @@ int CEinarZombieBull::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke
//========================================================= //=========================================================
BOOL CEinarZombieBull::CheckMeleeAttack1( float flDot, float flDist ) BOOL CEinarZombieBull::CheckMeleeAttack1( float flDot, float flDist )
{ {
if( m_hEnemy->pev->health <= gSkillData.bullsquidDmgWhip && flDist <= 110 && flDot >= 0.7 ) if( m_hEnemy->pev->health <= gSkillData.bullsquidDmgWhip && flDist <= 110 && flDot >= 0.7f )
{ {
return TRUE; return TRUE;
} }
@ -206,7 +206,7 @@ BOOL CEinarZombieBull::CheckMeleeAttack1( float flDot, float flDist )
//========================================================= //=========================================================
BOOL CEinarZombieBull::CheckMeleeAttack2( float flDot, float flDist ) BOOL CEinarZombieBull::CheckMeleeAttack2( float flDot, float flDist )
{ {
if( flDist <= 110 && flDot >= 0.7 && !HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) ) if( flDist <= 110 && flDot >= 0.7f && !HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) )
{ {
return TRUE; return TRUE;
} }

2
dlls/tripmine.cpp

@ -469,7 +469,7 @@ void CTripmine::PrimaryAttack( void )
}*/ }*/
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.3; m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.3f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
} }

Loading…
Cancel
Save