From 0f873c953da9525d8e863e27c68fafb28ef9f8f1 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Thu, 2 Jan 2020 19:03:57 +0500 Subject: [PATCH] Double promotion fixes. --- dlls/asheep/archer.cpp | 32 +++++++-------- dlls/asheep/barniel.cpp | 2 +- dlls/asheep/beretta.cpp | 10 ++--- dlls/asheep/gordonnadrian.cpp | 6 +-- dlls/asheep/kate.cpp | 6 +-- dlls/asheep/kmedkit.cpp | 6 +-- dlls/asheep/m41a.cpp | 24 +++++------ dlls/asheep/panther.cpp | 2 +- dlls/asheep/poolstick.cpp | 28 ++++++------- dlls/asheep/spforce.cpp | 2 +- dlls/asheep/terror.cpp | 2 +- dlls/asheep/toad.cpp | 76 +++++++++++++++++------------------ dlls/crossbow.cpp | 2 +- dlls/crowbar.cpp | 7 +--- dlls/hornetgun.cpp | 2 +- dlls/items.cpp | 2 +- dlls/rat.cpp | 8 ++-- dlls/triggers.cpp | 4 +- dlls/tripmine.cpp | 2 +- dlls/util.cpp | 2 +- dlls/zombie.cpp | 2 +- 21 files changed, 110 insertions(+), 117 deletions(-) diff --git a/dlls/asheep/archer.cpp b/dlls/asheep/archer.cpp index 7733ec72..255cb2b5 100644 --- a/dlls/asheep/archer.cpp +++ b/dlls/asheep/archer.cpp @@ -182,13 +182,13 @@ void CArcher::HandleAnimEvent( MonsterEvent_t *pEvent ) { CBaseEntity *pHurt = m_hEnemy; - if( m_flEnemyTouched < gpGlobals->time - 0.2 && ( m_hEnemy->BodyTarget( pev->origin ) - pev->origin).Length() > ( 32 + 16 + 32 ) ) + if( ( m_flEnemyTouched < gpGlobals->time - 0.2f ) && ( m_hEnemy->BodyTarget( pev->origin ) - pev->origin).Length() > ( 32 + 16 + 32 ) ) break; Vector vecShootDir = ShootAtEnemy( pev->origin ); UTIL_MakeAimVectors( pev->angles ); - if( DotProduct( vecShootDir, gpGlobals->v_forward ) > 0.707 ) + if( DotProduct( vecShootDir, gpGlobals->v_forward ) > 0.707f ) { m_bOnAttack = TRUE; pHurt->pev->punchangle.z = -18; @@ -356,7 +356,7 @@ void CArcher::MonsterThink( void ) void CArcher::Stop( void ) { if( !m_bOnAttack ) - m_flightSpeed = 40.0; + m_flightSpeed = 40.0f; } void CArcher::Swim() @@ -391,7 +391,7 @@ void CArcher::Swim() if( m_IdealActivity == ACT_RUN ) SetActivity( ACT_WALK ); if( m_IdealActivity == ACT_WALK ) - pev->framerate = m_flightSpeed / 150.0; + pev->framerate = m_flightSpeed / 150.0f; // ALERT( at_console, "walk %.2f\n", pev->framerate ); } else @@ -399,7 +399,7 @@ void CArcher::Swim() if( m_IdealActivity == ACT_WALK ) SetActivity( ACT_RUN ); if( m_IdealActivity == ACT_RUN) - pev->framerate = m_flightSpeed / 75.0; + pev->framerate = m_flightSpeed / 75.0f; // ALERT( at_console, "run %.2f\n", pev->framerate ); } /* @@ -432,10 +432,10 @@ void CArcher::Swim() // ALERT( at_console, "%f : %f\n", Angles.x, Forward.z ); float flDot = DotProduct( Forward, m_SaveVelocity ); - if( flDot > 0.5 ) + if( flDot > 0.5f ) pev->velocity = m_SaveVelocity = m_SaveVelocity * m_flightSpeed; - else if( flDot > 0 ) - pev->velocity = m_SaveVelocity = m_SaveVelocity * m_flightSpeed * ( flDot + 0.5 ); + else if( flDot > 0.0f ) + pev->velocity = m_SaveVelocity = m_SaveVelocity * m_flightSpeed * ( flDot + 0.5f ); else pev->velocity = m_SaveVelocity = m_SaveVelocity * 40; @@ -454,7 +454,7 @@ void CArcher::Swim() // if( Angles.x > 180 ) Angles.x = Angles.x - 360; - pev->angles.x = UTIL_Approach( Angles.x, pev->angles.x, 50 * 0.1 ); + pev->angles.x = UTIL_Approach( Angles.x, pev->angles.x, 50 * 0.1f ); if( pev->angles.x < -180 ) pev->angles.x = -180; if( pev->angles.x > 180 ) @@ -478,12 +478,12 @@ void CArcher::Swim() turn = Angles.y - pev->angles.y - 360; } - float speed = m_flightSpeed * 0.1; + float speed = m_flightSpeed * 0.1f; // ALERT( at_console, "speed %.0f %f\n", turn, speed ); if( fabs( turn ) > speed ) { - if( turn < 0.0 ) + if( turn < 0.0f ) { turn = -speed; } @@ -494,15 +494,15 @@ void CArcher::Swim() } pev->angles.y += turn; pev->angles.z -= turn; - pev->angles.y = fmod( ( pev->angles.y + 360.0 ), 360.0 ); + pev->angles.y = fmod( ( pev->angles.y + 360.0f ), 360.0f ); static float yaw_adj; - yaw_adj = yaw_adj * 0.8 + turn; + yaw_adj = yaw_adj * 0.8f + turn; // ALERT( at_console, "yaw %f : %f\n", turn, yaw_adj ); - SetBoneController( 0, -yaw_adj / 4.0 ); + SetBoneController( 0, -yaw_adj * 0.25f ); // Roll Smoothing // @@ -519,7 +519,7 @@ void CArcher::Swim() { turn = Angles.z - pev->angles.z - 360; } - speed = m_flightSpeed / 2 * 0.1; + speed = m_flightSpeed / 2 * 0.1f; if( fabs( turn ) < speed ) { @@ -527,7 +527,7 @@ void CArcher::Swim() } else { - if( turn < 0.0 ) + if( turn < 0.0f ) { pev->angles.z -= speed; } diff --git a/dlls/asheep/barniel.cpp b/dlls/asheep/barniel.cpp index 052b06c0..e3fdecaf 100644 --- a/dlls/asheep/barniel.cpp +++ b/dlls/asheep/barniel.cpp @@ -209,7 +209,7 @@ static BOOL IsFacing( entvars_t *pevTest, const Vector &reference ) UTIL_MakeVectorsPrivate( angle, forward, NULL, NULL ); // He's facing me, he meant it - if( DotProduct( forward, vecDir ) > 0.96 ) // +/- 15 degrees or so + if( DotProduct( forward, vecDir ) > 0.96f ) // +/- 15 degrees or so { return TRUE; } diff --git a/dlls/asheep/beretta.cpp b/dlls/asheep/beretta.cpp index b4037f5d..c40cbf0d 100644 --- a/dlls/asheep/beretta.cpp +++ b/dlls/asheep/beretta.cpp @@ -244,20 +244,20 @@ void CBeretta::WeaponIdle( void ) int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0, 1.0 ); - if (flRand <= 0.3 + 0 * 0.75) + if (flRand <= 0.3f) { iAnim = BERETTA_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 49.0 / 16; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 49.0f / 16.0f; } - else if (flRand <= 0.6 + 0 * 0.875) + else if (flRand <= 0.6f) { iAnim = BERETTA_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f / 16.0f; } else { iAnim = BERETTA_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0f / 16.0f; } SendWeaponAnim( iAnim, 1 ); } diff --git a/dlls/asheep/gordonnadrian.cpp b/dlls/asheep/gordonnadrian.cpp index 53817781..c189e796 100644 --- a/dlls/asheep/gordonnadrian.cpp +++ b/dlls/asheep/gordonnadrian.cpp @@ -98,7 +98,7 @@ CBaseEntity* CGordon::AdrianCheckTraceHullAttack( float flDist, int iDamage, int UTIL_MakeVectors( pev->angles ); Vector vecStart = pev->origin; - vecStart.z += pev->size.z * 0.5; + vecStart.z += pev->size.z * 0.5f; Vector vecEnd = vecStart + ( gpGlobals->v_forward * flDist ); UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); @@ -123,7 +123,7 @@ BOOL CGordon::CheckMeleeAttack1( float flDot, float flDist ) } } - if( flDist <= 64 && flDot >= 0.7 && + if( flDist <= 64 && flDot >= 0.7f && pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON && pEnemy->Classify() != CLASS_PLAYER_BIOWEAPON ) { @@ -307,7 +307,7 @@ static BOOL IsFacing( entvars_t *pevTest, const Vector &reference ) UTIL_MakeVectorsPrivate( angle, forward, NULL, NULL ); // He's facing me, he meant it - if( DotProduct( forward, vecDir ) > 0.96 ) // +/- 15 degrees or so + if( DotProduct( forward, vecDir ) > 0.96f ) // +/- 15 degrees or so { return TRUE; } diff --git a/dlls/asheep/kate.cpp b/dlls/asheep/kate.cpp index 9217f60e..440a299d 100644 --- a/dlls/asheep/kate.cpp +++ b/dlls/asheep/kate.cpp @@ -103,7 +103,7 @@ CBaseEntity* CKate::CheckTraceHullAttack( float flDist, int iDamage, int iDmgTyp UTIL_MakeVectors( pev->angles ); Vector vecStart = pev->origin; - vecStart.z += pev->size.z * 0.5; + vecStart.z += pev->size.z * 0.5f; Vector vecEnd = vecStart + ( gpGlobals->v_forward * flDist ); UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); @@ -128,7 +128,7 @@ BOOL CKate::CheckMeleeAttack1( float flDot, float flDist ) } } - if( flDist <= 64 && flDot >= 0.7 && + if( flDist <= 64 && flDot >= 0.7f && pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON && pEnemy->Classify() != CLASS_PLAYER_BIOWEAPON ) { @@ -319,7 +319,7 @@ static BOOL IsFacing( entvars_t *pevTest, const Vector &reference ) UTIL_MakeVectorsPrivate( angle, forward, NULL, NULL ); // He's facing me, he meant it - if( DotProduct( forward, vecDir ) > 0.96 ) // +/- 15 degrees or so + if( DotProduct( forward, vecDir ) > 0.96f ) // +/- 15 degrees or so { return TRUE; } diff --git a/dlls/asheep/kmedkit.cpp b/dlls/asheep/kmedkit.cpp index 669af060..2a674555 100644 --- a/dlls/asheep/kmedkit.cpp +++ b/dlls/asheep/kmedkit.cpp @@ -185,10 +185,10 @@ void CKMedKit::UseMedkit( int fMode ) 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 @@ -203,7 +203,7 @@ void CKMedKit::UseMedkit( int fMode ) // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); - if( tr.flFraction < 1.0 ) + if( tr.flFraction < 1.0f ) { CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); if( pEntity ) diff --git a/dlls/asheep/m41a.cpp b/dlls/asheep/m41a.cpp index 52350e21..d621b2c1 100644 --- a/dlls/asheep/m41a.cpp +++ b/dlls/asheep/m41a.cpp @@ -136,14 +136,14 @@ void CM41A::PrimaryAttack() if (m_pPlayer->pev->waterlevel == 3) { PlayEmptySound( ); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } if (m_iClip <= 0) { PlayEmptySound(); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } @@ -190,10 +190,10 @@ void CM41A::PrimaryAttack() // HEV suit - indicate out of ammo condition m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1f; if ( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() ) - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1f; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); } @@ -212,7 +212,7 @@ void CM41A::SecondaryAttack( void ) if (m_pPlayer->pev->waterlevel == 3) { PlayEmptySound( ); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } @@ -226,7 +226,7 @@ void CM41A::SecondaryAttack( void ) m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH; m_pPlayer->m_iExtraSoundTypes = bits_SOUND_DANGER; - m_pPlayer->m_flStopExtraSoundTime = UTIL_WeaponTimeBase() + 0.2; + m_pPlayer->m_flStopExtraSoundTime = UTIL_WeaponTimeBase() + 0.2f; m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType]--; @@ -242,12 +242,12 @@ void CM41A::SecondaryAttack( void ) // we don't add in player velocity anymore. CGrenade::ShootContact( m_pPlayer->pev, - m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16, - gpGlobals->v_forward * 800, gSkillData.plrDmgM41AGrenade ); + m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16, + gpGlobals->v_forward * 800, gSkillData.plrDmgM41AGrenade ); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1; - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5;// idle pretty soon after shooting. + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.0f; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0f;// idle pretty soon after shooting. if (!m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType]) // HEV suit - indicate out of ammo condition @@ -267,7 +267,7 @@ void CM41A::Reload( void ) if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == MP5_MAX_CLIP ) return; - DefaultReload( MP5_MAX_CLIP, M41A_RELOAD, 2.0 ); + DefaultReload( MP5_MAX_CLIP, M41A_RELOAD, 2.0f ); } diff --git a/dlls/asheep/panther.cpp b/dlls/asheep/panther.cpp index 06c6d30f..1423bdfb 100644 --- a/dlls/asheep/panther.cpp +++ b/dlls/asheep/panther.cpp @@ -405,7 +405,7 @@ void CPanther::ArmBeam( int side ) } // Couldn't find anything close enough - if( flDist == 1.0 ) + if( flDist == 1.0f ) return; DecalGunshot( &tr, BULLET_PLAYER_CROWBAR ); diff --git a/dlls/asheep/poolstick.cpp b/dlls/asheep/poolstick.cpp index 44a1f82a..8ff27690 100644 --- a/dlls/asheep/poolstick.cpp +++ b/dlls/asheep/poolstick.cpp @@ -119,7 +119,7 @@ extern void FindHullIntersection( const Vector &vecSrc, TraceResult &tr, float * vecHullEnd = vecSrc + ((vecHullEnd - vecSrc)*2); UTIL_TraceLine( vecSrc, vecHullEnd, dont_ignore_monsters, pEntity, &tmpTrace ); - if ( tmpTrace.flFraction < 1.0 ) + if ( tmpTrace.flFraction < 1.0f ) { tr = tmpTrace; return; @@ -136,7 +136,7 @@ extern void FindHullIntersection( const Vector &vecSrc, TraceResult &tr, float * vecEnd.z = vecHullEnd.z + minmaxs[k][2]; UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, pEntity, &tmpTrace ); - if ( tmpTrace.flFraction < 1.0 ) + if ( tmpTrace.flFraction < 1.0f ) { float thisDistance = (tmpTrace.vecEndPos - vecSrc).Length(); if ( thisDistance < distance ) @@ -162,7 +162,7 @@ void CPoolstick::PrimaryAttack() if (! Swing( 1 )) { SetThink( &CPoolstick::SwingAgain ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -192,10 +192,10 @@ int CPoolstick::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 @@ -207,7 +207,7 @@ int CPoolstick::Swing( int fFirst ) } #endif - if ( tr.flFraction >= 1.0 ) + if ( tr.flFraction >= 1.0f ) { if (fFirst) { @@ -224,7 +224,7 @@ int CPoolstick::Swing( int fFirst ) SendWeaponAnim( POOLSTICK_ATTACK3MISS ); break; } - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f; EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/pstk_miss1.wav", 1, ATTN_NORM, 0, 94 + RANDOM_LONG( 0, 0xF ) ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); @@ -325,10 +325,10 @@ int CPoolstick::Swing( int fFirst ) } m_pPlayer->m_iWeaponVolume = flVol * POOLSTICK_WALLHIT_VOLUME; - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; SetThink( &CPoolstick::Smack ); - pev->nextthink = UTIL_WeaponTimeBase() + 0.2; + pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; } m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); return fDidHit; @@ -350,22 +350,22 @@ void CPoolstick::WeaponIdle() { int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand > 0.9 ) + if( flRand > 0.9f ) { iAnim = POOLSTICK_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 = POOLSTICK_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f; } else { iAnim = POOLSTICK_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; } } SendWeaponAnim( iAnim ); diff --git a/dlls/asheep/spforce.cpp b/dlls/asheep/spforce.cpp index 593eb8a6..fe482acf 100644 --- a/dlls/asheep/spforce.cpp +++ b/dlls/asheep/spforce.cpp @@ -573,7 +573,7 @@ void CSPForceRepel::RepelUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, US pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetColor( 255, 255, 255 ); pBeam->SetThink( &CBeam::SUB_Remove ); - pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pSPForce->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pSPForce->pev->velocity.z + 0.5f; UTIL_Remove( this ); } diff --git a/dlls/asheep/terror.cpp b/dlls/asheep/terror.cpp index b598fc16..908729b1 100644 --- a/dlls/asheep/terror.cpp +++ b/dlls/asheep/terror.cpp @@ -989,7 +989,7 @@ void CTerrorRepel::RepelUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetColor( 255, 255, 255 ); pBeam->SetThink( &CBeam::SUB_Remove ); - pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pTerror->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pTerror->pev->velocity.z + 0.5f; UTIL_Remove( this ); } diff --git a/dlls/asheep/toad.cpp b/dlls/asheep/toad.cpp index a8369f73..9c87d095 100644 --- a/dlls/asheep/toad.cpp +++ b/dlls/asheep/toad.cpp @@ -86,7 +86,7 @@ TYPEDESCRIPTION CToadGrenade::m_SaveData[] = IMPLEMENT_SAVERESTORE( CToadGrenade, CGrenade ); -#define TOAD_DETONATE_DELAY 15.0 +#define TOAD_DETONATE_DELAY 15.0f int CToadGrenade :: Classify ( void ) { @@ -123,14 +123,14 @@ void CToadGrenade :: Spawn( void ) SetTouch( &CToadGrenade::SuperBounceTouch ); SetThink( &CToadGrenade::HuntThink ); - pev->nextthink = gpGlobals->time + 0.1; - m_flNextHunt = gpGlobals->time + 1E6; + pev->nextthink = gpGlobals->time + 0.1f; + m_flNextHunt = gpGlobals->time + (float)1E6; pev->flags |= FL_MONSTER; pev->takedamage = DAMAGE_AIM; pev->health = gSkillData.toadHealth; - pev->gravity = 0.5; - pev->friction = 0.5; + pev->gravity = 0.5f; + pev->friction = 0.5f; pev->dmg = gSkillData.toadDmgPop; @@ -166,7 +166,7 @@ void CToadGrenade :: Killed( entvars_t *pevAttacker, int iGib ) SetThink( &CToadGrenade::SUB_Remove ); // ResetTouch( ); SetTouch( NULL ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // since toad grenades never leave a body behind, clear out their takedamage now. // Squeaks do a bit of radius damage when they pop, and that radius damage will @@ -197,8 +197,6 @@ void CToadGrenade :: GibMonster( void ) EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "common/bodysplat.wav", 0.75, ATTN_NORM, 0, 200); } - - void CToadGrenade::HuntThink( void ) { // ALERT( at_console, "think\n" ); @@ -212,7 +210,7 @@ void CToadGrenade::HuntThink( void ) } StudioFrameAdvance( ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // explode when ready if (gpGlobals->time >= m_flDie) @@ -230,8 +228,8 @@ void CToadGrenade::HuntThink( void ) { pev->movetype = MOVETYPE_FLY; } - pev->velocity = pev->velocity * 0.9; - pev->velocity.z += 8.0; + pev->velocity = pev->velocity * 0.9f; + pev->velocity.z += 8.0f; } else if (pev->movetype == MOVETYPE_FLY) { @@ -242,8 +240,8 @@ void CToadGrenade::HuntThink( void ) if (m_flNextHunt > gpGlobals->time) return; - m_flNextHunt = gpGlobals->time + 2.0; - + m_flNextHunt = gpGlobals->time + 2.0f; + CBaseEntity *pOther = 0; Vector vecDir; TraceResult tr; @@ -262,14 +260,14 @@ void CToadGrenade::HuntThink( void ) } // squeek if it's about time blow up - if ((m_flDie - gpGlobals->time <= 0.5) && (m_flDie - gpGlobals->time >= 0.3)) + if ((m_flDie - gpGlobals->time <= 0.5f) && (m_flDie - gpGlobals->time >= 0.3f)) { EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "toad/toad_die1.wav", 1, ATTN_NORM, 0, 100 + RANDOM_LONG(0,0x3F)); CSoundEnt::InsertSound ( bits_SOUND_COMBAT, pev->origin, 256, 0.25 ); } // higher pitch as squeeker gets closer to detonation time - float flpitch = 155.0 - 60.0 * ((m_flDie - gpGlobals->time) / TOAD_DETONATE_DELAY); + float flpitch = 155.0f - 60.0f * ((m_flDie - gpGlobals->time) / TOAD_DETONATE_DELAY); if (flpitch < 80) flpitch = 80; @@ -282,10 +280,10 @@ void CToadGrenade::HuntThink( void ) } float flVel = pev->velocity.Length(); - float flAdj = 50.0 / (flVel + 10.0); + float flAdj = 50.0f / (flVel + 10.0f); - if (flAdj > 1.2) - flAdj = 1.2; + if (flAdj > 1.2f) + flAdj = 1.2f; // ALERT( at_console, "think : enemy\n"); @@ -307,7 +305,7 @@ void CToadGrenade::HuntThink( void ) } } - if ((pev->origin - m_posPrev).Length() < 1.0) + if ((pev->origin - m_posPrev).Length() < 1.0f) { pev->velocity.x = RANDOM_FLOAT( -100, 100 ); pev->velocity.y = RANDOM_FLOAT( -100, 100 ); @@ -341,7 +339,7 @@ void CToadGrenade::SuperBounceTouch( CBaseEntity *pOther ) return; // higher pitch as squeeker gets closer to detonation time - flpitch = 155.0 - 60.0 * ((m_flDie - gpGlobals->time) / TOAD_DETONATE_DELAY); + flpitch = 155.0f - 60.0f * ((m_flDie - gpGlobals->time) / TOAD_DETONATE_DELAY); if ( pOther->pev->takedamage && m_flNextAttack < gpGlobals->time ) { @@ -366,7 +364,7 @@ void CToadGrenade::SuperBounceTouch( CBaseEntity *pOther ) // make bite sound EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, "toad/toad_deploy1.wav", 1.0, ATTN_NORM, 0, (int)flpitch); - m_flNextAttack = gpGlobals->time + 0.5; + m_flNextAttack = gpGlobals->time + 0.5f; } } else @@ -375,7 +373,7 @@ void CToadGrenade::SuperBounceTouch( CBaseEntity *pOther ) } } - m_flNextHit = gpGlobals->time + 0.1; + m_flNextHit = gpGlobals->time + 0.1f; m_flNextHunt = gpGlobals->time; if ( g_pGameRules->IsMultiplayer() ) @@ -393,9 +391,9 @@ void CToadGrenade::SuperBounceTouch( CBaseEntity *pOther ) // play bounce sound float flRndSound = RANDOM_FLOAT ( 0 , 1 ); - if ( flRndSound <= 0.33 ) + if ( flRndSound <= 0.33f ) EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "toad/toad_hunt1.wav", 1, ATTN_NORM, 0, (int)flpitch); - else if (flRndSound <= 0.66) + else if (flRndSound <= 0.66f) EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "toad/toad_hunt2.wav", 1, ATTN_NORM, 0, (int)flpitch); else EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "toad/toad_hunt3.wav", 1, ATTN_NORM, 0, (int)flpitch); @@ -407,7 +405,7 @@ void CToadGrenade::SuperBounceTouch( CBaseEntity *pOther ) CSoundEnt::InsertSound ( bits_SOUND_COMBAT, pev->origin, 100, 0.1 ); } - m_flNextBounceSoundTime = gpGlobals->time + 0.5;// half second. + m_flNextBounceSoundTime = gpGlobals->time + 0.5f;// half second. } #endif @@ -427,7 +425,7 @@ void CToad::Spawn( ) pev->sequence = 1; pev->animtime = gpGlobals->time; - pev->framerate = 1.0; + pev->framerate = 1.0f; SetThink( &CToad::ToadIdle ); pev->nextthink = gpGlobals->time + 0.2f; @@ -474,7 +472,7 @@ BOOL CToad::Deploy( ) // play hunt sound float flRndSound = RANDOM_FLOAT( 0, 1 ); - if ( flRndSound <= 0.5 ) + if( flRndSound <= 0.5f ) EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "toad/toad_hunt2.wav", 1, ATTN_NORM, 0, 100); else EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "toad/toad_hunt3.wav", 1, ATTN_NORM, 0, 100); @@ -482,20 +480,20 @@ BOOL CToad::Deploy( ) m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.1; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.1f; return DefaultDeploy( "models/v_toad.mdl", "models/p_toad.mdl", TOAD_UP, "toad" ); } void CToad::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; - - if ( !m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] ) + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; + + if( !m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] ) { m_pPlayer->pev->weapons &= ~(1<nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return; } @@ -512,7 +510,7 @@ void CToad::PrimaryAttack() return; } - if ( m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] ) + if( m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] ) { UTIL_MakeVectors( m_pPlayer->pev->v_angle ); TraceResult tr; @@ -521,7 +519,7 @@ void CToad::PrimaryAttack() // HACK HACK: Ugly hacks to handle change in origin based on new physics code for players // Move origin up if crouched and start trace a bit outside of body ( 20 units instead of 16 ) trace_origin = m_pPlayer->pev->origin; - if ( m_pPlayer->pev->flags & FL_DUCKING ) + if( m_pPlayer->pev->flags & FL_DUCKING ) { trace_origin = trace_origin - ( VEC_HULL_MIN - VEC_DUCK_HULL_MIN ); } @@ -529,7 +527,7 @@ void CToad::PrimaryAttack() // find place to toss monster UTIL_TraceLine( trace_origin + gpGlobals->v_forward * 20, trace_origin + gpGlobals->v_forward * 64, dont_ignore_monsters, NULL, &tr ); - if ( tr.fAllSolid == 0 && tr.fStartSolid == 0 && tr.flFraction > 0.25 ) + if( tr.fAllSolid == 0 && tr.fStartSolid == 0 && tr.flFraction > 0.25f ) { SendWeaponAnim( TOAD_THROW ); @@ -542,9 +540,9 @@ void CToad::PrimaryAttack() #endif // play hunt sound - float flRndSound = RANDOM_FLOAT ( 0 , 1 ); + float flRndSound = RANDOM_FLOAT( 0 , 1 ); - if ( flRndSound <= 0.5 ) + if( flRndSound <= 0.5f ) EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "toad/toad_hunt2.wav", 1, ATTN_NORM, 0, 105); else EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "toad/toad_hunt3.wav", 1, ATTN_NORM, 0, 105); @@ -555,8 +553,8 @@ void CToad::PrimaryAttack() m_fJustThrown = 1; - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.3f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; } } } diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index db18e1d3..779fa09c 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -415,7 +415,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 373b1b4b..1d0869a0 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -217,7 +217,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 ) ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); // player "shoot" animation @@ -339,11 +339,6 @@ int CCrowbar::Swing( int fFirst ) SetThink( &CCrowbar::Smack ); pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; -#endif -#if CROWBAR_DELAY_FIX - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; -#else - m_flNextPrimaryAttack = GetNextAttackDelay( 0.25f ); #endif m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; } diff --git a/dlls/hornetgun.cpp b/dlls/hornetgun.cpp index 87454cf5..91bddcb9 100644 --- a/dlls/hornetgun.cpp +++ b/dlls/hornetgun.cpp @@ -227,7 +227,7 @@ void CHgun::SecondaryAttack( void ) m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME; m_pPlayer->m_iWeaponFlash = DIM_GUN_FLASH; - m_flRechargeTime = gpGlobals->time + 0.5; + m_flRechargeTime = gpGlobals->time + 0.5f; SendWeaponAnim( HGUN_SHOOT ); diff --git a/dlls/items.cpp b/dlls/items.cpp index b618e53e..f097886e 100644 --- a/dlls/items.cpp +++ b/dlls/items.cpp @@ -291,7 +291,7 @@ class CItemBattery : public CItem { EMIT_SOUND( pPlayer->edict(), CHAN_ITEM, "barney/nope.wav", 1, ATTN_NORM ); UTIL_ShowMessageAll( "NOHEVBATTERY" ); - NextMessageTime = gpGlobals->time + 4.0; + NextMessageTime = gpGlobals->time + 4.0f; } return FALSE; } diff --git a/dlls/rat.cpp b/dlls/rat.cpp index 7ca93259..31be0b44 100644 --- a/dlls/rat.cpp +++ b/dlls/rat.cpp @@ -165,7 +165,7 @@ void CRat::HandleAnimEvent( MonsterEvent_t *pEvent ) // Scale the sideways velocity to get there at the right time vecJumpDir = m_hEnemy->pev->origin + m_hEnemy->pev->view_ofs - pev->origin; - vecJumpDir = vecJumpDir * ( 1.0 / time ); + vecJumpDir = vecJumpDir * ( 1.0f / time ); // Speed to offset gravity at the desired height vecJumpDir.z = speed; @@ -173,9 +173,9 @@ void CRat::HandleAnimEvent( MonsterEvent_t *pEvent ) // Don't jump too far/fast float distance = vecJumpDir.Length(); - if( distance > 650 ) + if( distance > 650.0f ) { - vecJumpDir = vecJumpDir * ( 650.0 / distance ); + vecJumpDir = vecJumpDir * ( 650.0f / distance ); } } else @@ -188,7 +188,7 @@ void CRat::HandleAnimEvent( MonsterEvent_t *pEvent ) EMIT_SOUND_DYN( edict(), CHAN_VOICE, pAttackSounds[0], GetSoundVolue(), ATTN_IDLE, 0, GetVoicePitch() ); pev->velocity = vecJumpDir; - m_flNextAttack = gpGlobals->time + 2; + m_flNextAttack = gpGlobals->time + 2.0f; } break; default: diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index 75a7c0c1..340fc2b5 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -2502,9 +2502,9 @@ void CTriggerKateHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE CBaseEntity *pEntity = UTIL_FindEntityByTargetname( 0, STRING( m_szKateName ) ); if( pEntity ) { - ALERT( at_console, "trigger_katehealth: Kate health before: %f\n", pEntity->pev->health ); + ALERT( at_console, "trigger_katehealth: Kate health before: %f\n", (double)pEntity->pev->health ); pEntity->pev->health = gSkillData.kateHealth; - ALERT( at_console, "trigger_katehealth: Kate health after: %f\n", pEntity->pev->health ); + ALERT( at_console, "trigger_katehealth: Kate health after: %f\n", (double)pEntity->pev->health ); } else { diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 528fe87b..5b97da9c 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -475,7 +475,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 ); } diff --git a/dlls/util.cpp b/dlls/util.cpp index 9aefafd0..5546a9d3 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -78,7 +78,7 @@ void UTIL_CreateWarpball( edict_t *ent, Vector vecSrc, float spawnVol, float spa UTIL_TraceLine( vecSrc, vecSrc + vecDir * 1024, ignore_monsters, ent, &tr ); vecEnd = tr.vecEndPos; - if( ( vecEnd - vecSrc ).Length() >= ( 1024 * 0.1f ) && tr.flFraction != 1.0 ) + if( ( vecEnd - vecSrc ).Length() >= ( 1024 * 0.1f ) && tr.flFraction != 1.0f ) { MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); WRITE_BYTE( TE_BEAMPOINTS ); diff --git a/dlls/zombie.cpp b/dlls/zombie.cpp index 77b814c4..e22c2d92 100644 --- a/dlls/zombie.cpp +++ b/dlls/zombie.cpp @@ -276,7 +276,7 @@ void CZombie::Spawn() if( FClassnameIs( pev, "monster_zombie" ) ) pev->health = gSkillData.zombieHealth; else - pev->health = gSkillData.zombieHealth * 1.25; + pev->health = gSkillData.zombieHealth * 1.25f; pev->view_ofs = VEC_VIEW;// position of the eyes relative to monster's origin. m_flFieldOfView = 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE;