diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 8fbd3c4e..8d879179 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -1109,9 +1109,9 @@ void EV_TrainPitchAdjust( event_args_t *args ) us_params = (unsigned short)args->iparam1; 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 ); - pitch = (int)( 10.0 * (float)( ( us_params >> 6 ) & 0x003f ) ); + pitch = (int)( 10.0f * (float)( ( us_params >> 6 ) & 0x003f ) ); switch( noise ) { diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index 8903e1dd..3222e2dc 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -420,7 +420,7 @@ void CCrossbow::FireSniperBolt() if( FClassnameIs( tr.pHit, "worldspawn" ) ) { // 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 { diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index db673908..2e4577bb 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -220,7 +220,7 @@ int CCrowbar::Swing( int fFirst ) SendWeaponAnim( CROWBAR_ATTACK3MISS ); 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 ) ); #ifdef CROWBAR_IDLE_ANIM m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); diff --git a/dlls/egon.cpp b/dlls/egon.cpp index 7de090f7..9e675b9f 100644 --- a/dlls/egon.cpp +++ b/dlls/egon.cpp @@ -195,7 +195,7 @@ void CEgon::PrimaryAttack( void ) m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2f; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; } void CEgon::WeaponIdle( void ) diff --git a/dlls/handgrenade.cpp b/dlls/handgrenade.cpp index 2c177f42..116b18d1 100644 --- a/dlls/handgrenade.cpp +++ b/dlls/handgrenade.cpp @@ -245,8 +245,8 @@ CGrenade *CHandGrenade::ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector pGrenade->pev->dmgtime = gpGlobals->time + time; pGrenade->SetThink( &CGrenade::TumbleThink ); - pGrenade->pev->nextthink = gpGlobals->time + 0.1; - if( time < 0.1 ) + pGrenade->pev->nextthink = gpGlobals->time + 0.1f; + if( time < 0.1f ) { pGrenade->pev->nextthink = gpGlobals->time; pGrenade->pev->velocity = Vector( 0, 0, 0 ); diff --git a/dlls/houndeye.cpp b/dlls/houndeye.cpp index f7a36a74..dcbd0de0 100644 --- a/dlls/houndeye.cpp +++ b/dlls/houndeye.cpp @@ -421,7 +421,7 @@ void CHoundeye::WarmUpSound( void ) { Vector vecMouthPos, vecMouthAng; CBaseEntity *pHurt = 0; - pHurt = CheckTraceHullAttack( 80, gSkillData.houndeyeDmgBlast * 0.4, DMG_SLASH ); + pHurt = CheckTraceHullAttack( 80, gSkillData.houndeyeDmgBlast * 0.4f, DMG_SLASH ); if( pHurt ) { diff --git a/dlls/hunger/ap9.cpp b/dlls/hunger/ap9.cpp index 795b51af..4e9ca6d6 100644 --- a/dlls/hunger/ap9.cpp +++ b/dlls/hunger/ap9.cpp @@ -103,13 +103,13 @@ BOOL CWeaponEinarAP9::Deploy() void CWeaponEinarAP9::SecondaryAttack() { m_iBurstShots += 2; - AP9Fire( 0.035, 0.6, FALSE ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.04; + AP9Fire( 0.035f, 0.6f, FALSE ); + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.04f; } void CWeaponEinarAP9::PrimaryAttack() { - AP9Fire( 0.07, 0.125, TRUE ); + AP9Fire( 0.07f, 0.125f, TRUE ); } 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 ) { PlayEmptySound(); - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2f; } return; } @@ -189,7 +189,7 @@ void CWeaponEinarAP9::Reload() #else if( !g_pGameRules->IsMultiplayer() ) #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 ); } } @@ -216,7 +216,7 @@ void CWeaponEinarAP9::WeaponIdle() { 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. } } diff --git a/dlls/hunger/boss.cpp b/dlls/hunger/boss.cpp index c0eb2231..fdf51360 100644 --- a/dlls/hunger/boss.cpp +++ b/dlls/hunger/boss.cpp @@ -42,7 +42,7 @@ void CEinarBoss::Spawn() pev->model = MAKE_STRING( "models/boss.mdl" ); if( !pev->health ) - pev->health = gSkillData.apacheHealth * 2; + pev->health = gSkillData.apacheHealth * 2.0f; CApache::Spawn(); } @@ -98,7 +98,7 @@ BOOL CEinarBoss::FireGun() GetAttachment( 0, posBarrel, angBarrel ); 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 ); EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "turret/tu_fire1.wav", 1, 0.3 ); diff --git a/dlls/hunger/chaingun.cpp b/dlls/hunger/chaingun.cpp index c44f69a3..c93ae218 100644 --- a/dlls/hunger/chaingun.cpp +++ b/dlls/hunger/chaingun.cpp @@ -100,7 +100,7 @@ void CWeaponEinarChaingun::Holster( int skiplocal /*= 0*/ ) SpinDown(); else SendWeaponAnim( CHAINGUN_HOLSTER ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; } void CWeaponEinarChaingun::PrimaryAttack() @@ -116,7 +116,7 @@ void CWeaponEinarChaingun::PrimaryAttack() else { PlayEmptySound(); - m_flNextSecondaryAttack = m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2; + m_flNextSecondaryAttack = m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2f; } 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 ); m_fInAttack = 1; - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; } @@ -173,10 +173,10 @@ void CWeaponEinarChaingun::SpinDown() // 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 ); - 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_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; } 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 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() @@ -225,7 +225,7 @@ void CWeaponEinarChaingun::Reload() { 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 ); } } @@ -244,7 +244,7 @@ void CWeaponEinarChaingun::WeaponIdle() 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 ) ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; m_fInSpecialReload = 3; } } @@ -261,7 +261,7 @@ void CWeaponEinarChaingun::WeaponIdle() { int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.5 ) + if( flRand <= 0.5f ) { iAnim = CHAINGUN_IDLE; } diff --git a/dlls/hunger/civilian.cpp b/dlls/hunger/civilian.cpp index 34f9e3ff..d863bf43 100644 --- a/dlls/hunger/civilian.cpp +++ b/dlls/hunger/civilian.cpp @@ -177,7 +177,7 @@ void CEinarSittingCivilian::Spawn() ResetSequenceInfo(); SetThink( &CEinarSittingCivilian::SittingThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; DROP_TO_FLOOR( ENT( pev ) ); } diff --git a/dlls/hunger/cyberfranklin.cpp b/dlls/hunger/cyberfranklin.cpp index 6b566de5..d3f7651a 100644 --- a/dlls/hunger/cyberfranklin.cpp +++ b/dlls/hunger/cyberfranklin.cpp @@ -120,7 +120,7 @@ void CEinarCyberFranklin::PainSound() if( m_flNextPainTime > gpGlobals->time ) 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 ); } diff --git a/dlls/hunger/flame.cpp b/dlls/hunger/flame.cpp index 09aa8793..00b5b935 100644 --- a/dlls/hunger/flame.cpp +++ b/dlls/hunger/flame.cpp @@ -60,7 +60,7 @@ void CEinarFlameRocket::Spawn() SetTouch( &CEinarFlameRocket::FlameTouch ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 1.1; + pev->nextthink = gpGlobals->time + 1.1f; UTIL_MakeVectors( pev->angles ); pev->velocity = gpGlobals->v_forward * pev->speed; @@ -97,8 +97,8 @@ void CEinarFlameRocket::FlameTouch( CBaseEntity *pOther ) pevOwner = 0; } - pev->dmg = g_pGameRules->IsMultiplayer() ? gSkillData.plrDmgEgonWide : ( gSkillData.plrDmgEgonNarrow * 1.5 ); - pev->dmg *= 2; + pev->dmg = g_pGameRules->IsMultiplayer() ? gSkillData.plrDmgEgonWide : ( gSkillData.plrDmgEgonNarrow * 1.5f ); + pev->dmg *= 2.0f; ClearMultiDamage(); pOther->TraceAttack(pevOwner, pev->dmg, pev->velocity.Normalize(), &tr, DMG_BURN ); diff --git a/dlls/hunger/medkit.cpp b/dlls/hunger/medkit.cpp index 613cf4d8..3ce116b6 100644 --- a/dlls/hunger/medkit.cpp +++ b/dlls/hunger/medkit.cpp @@ -80,7 +80,7 @@ BOOL CWeaponEinarMedkit::Deploy() void CWeaponEinarMedkit::Holster(int skiplocal /*= 0*/) { m_fInAttack = 0; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( MEDKIT_HOLSTER ); } @@ -92,10 +92,10 @@ void CWeaponEinarMedkit::PrimaryAttack() if( m_fFireOnEmpty ) { PlayEmptySound(); - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; } return; - } + } if( m_fInAttack ) { @@ -117,7 +117,7 @@ void CWeaponEinarMedkit::Use() { SendWeaponAnim( MEDKIT_LONGUSE, 0 ); 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() @@ -134,7 +134,7 @@ void CWeaponEinarMedkit::Heal() m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 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() @@ -156,7 +156,7 @@ void CWeaponEinarMedkit::WeaponIdle() } SendWeaponAnim( MEDKIT_IDLE, 0 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; } BOOL CWeaponEinarMedkit::PlayEmptySound() diff --git a/dlls/hunger/megasquid.cpp b/dlls/hunger/megasquid.cpp index 72f5969c..8ce6c097 100644 --- a/dlls/hunger/megasquid.cpp +++ b/dlls/hunger/megasquid.cpp @@ -110,7 +110,7 @@ void CEinarMegasquid::Precache() //========================================================= 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 ) { @@ -124,12 +124,12 @@ BOOL CEinarMegasquid::CheckRangeAttack1( float flDot, float flDist ) if( IsMoving() ) { // don't spit again for a long time, resume chasing enemy. - m_flNextSpitTime = gpGlobals->time + 5; + m_flNextSpitTime = gpGlobals->time + 5.0f; } else { // not moving, so spit again pretty soon. - m_flNextSpitTime = gpGlobals->time + 0.5; + m_flNextSpitTime = gpGlobals->time + 0.5f; } return TRUE; @@ -146,7 +146,7 @@ BOOL CEinarMegasquid::CheckRangeAttack1( 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)) return TRUE; } diff --git a/dlls/hunger/shovel.cpp b/dlls/hunger/shovel.cpp index eddb1799..4d06946c 100644 --- a/dlls/hunger/shovel.cpp +++ b/dlls/hunger/shovel.cpp @@ -107,7 +107,7 @@ BOOL CWeaponEinarShovel::Deploy() 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 ); } @@ -116,7 +116,7 @@ void CWeaponEinarShovel::PrimaryAttack() if( !Swing( 1 ) ) { 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 ); #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 ); - 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 // This is and approximation of the "best" intersection @@ -157,12 +157,12 @@ int CWeaponEinarShovel::Swing( int fFirst ) } } #endif - if( tr.flFraction >= 1.0 ) + if( tr.flFraction >= 1.0f ) { if( fFirst ) { // miss - if( RANDOM_FLOAT( 0.0, 1.0 ) <= 0.25 ) + if( RANDOM_FLOAT( 0.0f, 1.0f ) <= 0.25f ) ++m_iSwing; switch( ( m_iSwing++ ) % 2 ) { @@ -176,7 +176,7 @@ int CWeaponEinarShovel::Swing( int fFirst ) SendWeaponAnim( SHOVEL_ATTACK3MISS ); break;*/ } - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f; // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); @@ -211,7 +211,7 @@ int CWeaponEinarShovel::Swing( int fFirst ) CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); // play thwack, smack, or dong sound - float flVol = 1.0; + float flVol = 1.0f; int fHitWorld = TRUE; if( pEntity ) @@ -222,17 +222,17 @@ int CWeaponEinarShovel::Swing( int fFirst ) if( g_pGameRules->IsMultiplayer() ) { // 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 - flDmg = gSkillData.plrDmgCrowbar * 1.2; + flDmg = gSkillData.plrDmgCrowbar * 1.2f; } else { // 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 ); ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); @@ -277,7 +277,7 @@ int CWeaponEinarShovel::Swing( int fFirst ) if( !pEntity->IsAlive() ) return TRUE; else - flVol = 0.1; + flVol = 0.1f; fHitWorld = FALSE; } @@ -315,10 +315,10 @@ int CWeaponEinarShovel::Swing( int fFirst ) m_pPlayer->m_iWeaponVolume = flVol * SHOVEL_WALLHIT_VOLUME; #endif - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; SetThink( &CWeaponEinarShovel::Smack ); - pev->nextthink = UTIL_WeaponTimeBase() + 0.2; + pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; } #ifdef CROWBAR_IDLE_ANIM m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); @@ -333,22 +333,22 @@ void CWeaponEinarShovel::WeaponIdle( void ) { int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand > 0.9 ) + if( flRand > 0.9f ) { iAnim = SHOVEL_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; } else { - if( flRand > 0.5 ) + if( flRand > 0.5f ) { iAnim = SHOVEL_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f; } else { iAnim = SHOVEL_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; } } SendWeaponAnim( iAnim ); diff --git a/dlls/hunger/sniper.cpp b/dlls/hunger/sniper.cpp index 04a804c3..d2a4196b 100644 --- a/dlls/hunger/sniper.cpp +++ b/dlls/hunger/sniper.cpp @@ -51,7 +51,7 @@ void CWeaponEinarSniper::Holster( int skiplocal /* = 0 */ ) if( m_fInZoom ) SecondaryAttack(); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; } int CWeaponEinarSniper::GetItemInfo( ItemInfo *p ) @@ -122,8 +122,8 @@ void CWeaponEinarSniper::SecondaryAttack() #ifndef CLIENT_DLL UTIL_ScreenFade( m_pPlayer, Vector( 0, 255, 0 ), 0.0, 0.0, 70, iFadeFlags ); #endif - pev->nextthink = UTIL_WeaponTimeBase() + 0.11; - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75; + pev->nextthink = UTIL_WeaponTimeBase() + 0.11f; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75f; } void CWeaponEinarSniper::PrimaryAttack() @@ -137,7 +137,7 @@ void CWeaponEinarSniper::PrimaryAttack() if( m_fFireOnEmpty ) { PlayEmptySound(); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; } if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 15, 20 ); @@ -167,12 +167,12 @@ void CWeaponEinarSniper::PrimaryAttack() { if( m_fInZoom ) { - flSpread = 0.002; + flSpread = 0.002f; iDmg = 80; } else { - flSpread = 0.07846; + flSpread = 0.07846f; iDmg = 40; } } @@ -180,11 +180,11 @@ void CWeaponEinarSniper::PrimaryAttack() { if( m_fInZoom ) { - flSpread = 0.004; + flSpread = 0.004f; } else { - flSpread = 0.08716; + flSpread = 0.08716f; } iDmg = 0; } @@ -206,13 +206,13 @@ void CWeaponEinarSniper::PrimaryAttack() if( m_fInZoom ) { - m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f; } else { - m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.11; - m_pPlayer->pev->punchangle.x -= ( RANDOM_FLOAT( 0, 2.0 ) + 4.0 ); - m_pPlayer->pev->punchangle.y -= ( 1.0 - RANDOM_FLOAT( 0, 2.0 ) ); + m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.11f; + m_pPlayer->pev->punchangle.x -= ( RANDOM_FLOAT( 0.0f, 2.0f ) + 4.0f ); + m_pPlayer->pev->punchangle.y -= ( 1.0f - RANDOM_FLOAT( 0.0f, 2.0f ) ); } } @@ -224,13 +224,13 @@ void CWeaponEinarSniper::Reload() if( m_fInZoom ) SecondaryAttack(); - int iResult = DefaultReload( SNIPER_MAX_CLIP, SNIPER_RELOAD, 3.3 ); + int iResult = DefaultReload( SNIPER_MAX_CLIP, SNIPER_RELOAD, 3.3f ); } void CWeaponEinarSniper::WeaponIdle() { ResetEmptySound(); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; } class CSniperAmmo : public CBasePlayerAmmo diff --git a/dlls/hunger/spanner.cpp b/dlls/hunger/spanner.cpp index 2f39e590..c7804b8e 100644 --- a/dlls/hunger/spanner.cpp +++ b/dlls/hunger/spanner.cpp @@ -102,7 +102,7 @@ BOOL CWeaponEinarSpanner::Deploy() 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 ); } @@ -111,7 +111,7 @@ void CWeaponEinarSpanner::PrimaryAttack() if( !Swing( 1 ) ) { 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 ); #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 ); - 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 // This is and approximation of the "best" intersection @@ -152,12 +152,12 @@ int CWeaponEinarSpanner::Swing( int fFirst ) } } #endif - if( tr.flFraction >= 1.0 ) + if( tr.flFraction >= 1.0f ) { if( fFirst ) { // miss - if( RANDOM_FLOAT( 0.0, 1.0 ) <= 0.25 ) + if( RANDOM_FLOAT( 0.0f, 1.0f ) <= 0.25f ) ++m_iSwing; switch( ( m_iSwing++ ) % 2 ) { @@ -168,7 +168,7 @@ int CWeaponEinarSpanner::Swing( int fFirst ) SendWeaponAnim( SPANNER_ATTACK2 ); 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 ) ); #ifdef CROWBAR_IDLE_ANIM @@ -209,17 +209,17 @@ int CWeaponEinarSpanner::Swing( int fFirst ) if( g_pGameRules->IsMultiplayer() ) { // 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 - flDmg = gSkillData.plrDmgCrowbar * 0.8; + flDmg = gSkillData.plrDmgCrowbar * 0.8f; } else { // 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 ); ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); @@ -301,10 +301,10 @@ int CWeaponEinarSpanner::Swing( int fFirst ) m_pPlayer->m_iWeaponVolume = flVol * SPANNER_WALLHIT_VOLUME; #endif - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2f; SetThink( &CWeaponEinarSpanner::Smack ); - pev->nextthink = UTIL_WeaponTimeBase() + 0.2; + pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; } #ifdef CROWBAR_IDLE_ANIM m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); diff --git a/dlls/hunger/taurus.cpp b/dlls/hunger/taurus.cpp index 881b663c..3fd16ea1 100644 --- a/dlls/hunger/taurus.cpp +++ b/dlls/hunger/taurus.cpp @@ -114,7 +114,7 @@ void CWeaponEinarTaurus::TaurusFire( float flSpread, float flCycleTime, BOOL fUs if( m_fFireOnEmpty ) { PlayEmptySound(); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2f; } return; } @@ -178,11 +178,11 @@ void CWeaponEinarTaurus::WeaponIdle() int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0, 1.0 ); - if( flRand <= 0.3 ) + if( flRand <= 0.3f ) { iAnim = TAURUS_IDLE3; } - else if( flRand <= 0.6 ) + else if( flRand <= 0.6f ) { iAnim = TAURUS_IDLE1; } @@ -190,7 +190,7 @@ void CWeaponEinarTaurus::WeaponIdle() { iAnim = TAURUS_IDLE2; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 15.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 15.0f; SendWeaponAnim( iAnim, 1 ); } } diff --git a/dlls/hunger/tfcsniper.cpp b/dlls/hunger/tfcsniper.cpp index c656948e..ba15ce8f 100644 --- a/dlls/hunger/tfcsniper.cpp +++ b/dlls/hunger/tfcsniper.cpp @@ -104,7 +104,7 @@ void CWeaponEinarTFCSniper::Holster( int skiplocal /* = 0 */ ) SecondaryAttack(); } - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; } void CWeaponEinarTFCSniper::PrimaryAttack() @@ -118,7 +118,7 @@ void CWeaponEinarTFCSniper::PrimaryAttack() if( m_fFireOnEmpty ) { PlayEmptySound(); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; } if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) { @@ -151,12 +151,12 @@ void CWeaponEinarTFCSniper::PrimaryAttack() { if( m_fInZoom ) { - flSpread = 0.002; + flSpread = 0.002f; iDmg = 80; } else { - flSpread = 0.07846; + flSpread = 0.07846f; iDmg = 40; } } @@ -164,11 +164,11 @@ void CWeaponEinarTFCSniper::PrimaryAttack() { if( m_fInZoom ) { - flSpread = 0.004; + flSpread = 0.004f; } else { - flSpread = 0.08716; + flSpread = 0.08716f; } iDmg = 0; } @@ -190,13 +190,13 @@ void CWeaponEinarTFCSniper::PrimaryAttack() if( m_fInZoom ) { - m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f; } else { - m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.11; - m_pPlayer->pev->punchangle.x -= ( RANDOM_FLOAT( 0, 2.0 ) + 4.0 ); - m_pPlayer->pev->punchangle.y -= ( 1.0 - RANDOM_FLOAT( 0, 2.0 ) ); + m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.11f; + m_pPlayer->pev->punchangle.x -= ( RANDOM_FLOAT( 0.0f, 2.0f ) + 4.0f ); + m_pPlayer->pev->punchangle.y -= ( 1.0f - RANDOM_FLOAT( 0.0f, 2.0f ) ); } } @@ -218,8 +218,8 @@ void CWeaponEinarTFCSniper::SecondaryAttack() #ifndef CLIENT_DLL UTIL_ScreenFade( m_pPlayer, Vector( 0, 255, 0 ), 0.0, 0.0, 70, iFadeFlags ); #endif - pev->nextthink = UTIL_WeaponTimeBase() + 0.11; - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75; + pev->nextthink = UTIL_WeaponTimeBase() + 0.11f; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75f; } void CWeaponEinarTFCSniper::Reload() @@ -233,7 +233,7 @@ void CWeaponEinarTFCSniper::Reload() if( DefaultReload( SNIPER_MAX_CLIP, TFCSNIPER_AUTOHOLSTER, 0.5 ) ) { 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 ); } } @@ -251,7 +251,7 @@ void CWeaponEinarTFCSniper::WeaponIdle() 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 ) ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; m_fInSpecialReload = 3; } if( m_flTimeWeaponIdle <= UTIL_WeaponTimeBase() ) diff --git a/dlls/hunger/zombiebull.cpp b/dlls/hunger/zombiebull.cpp index 30010504..857a0ad1 100644 --- a/dlls/hunger/zombiebull.cpp +++ b/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. - 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 ); } @@ -191,7 +191,7 @@ int CEinarZombieBull::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke //========================================================= 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; } @@ -206,7 +206,7 @@ BOOL CEinarZombieBull::CheckMeleeAttack1( 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; } diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index c5867303..3e0b08a6 100644 --- a/dlls/tripmine.cpp +++ b/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 ); }