From 02ee5fe4f6df9728ee5dc67a71d3bfbab399d6ef Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Fri, 3 Jan 2020 01:06:00 +0500 Subject: [PATCH] Double promotion fixes. --- dlls/combat.cpp | 2 +- dlls/h_battery.cpp | 2 +- dlls/player.cpp | 2 +- dlls/visitors/pipe.cpp | 20 ++++++++++---------- dlls/visitors/sniper.cpp | 18 +++++++++--------- dlls/weapons.cpp | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dlls/combat.cpp b/dlls/combat.cpp index 1e535c84..a732fec0 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -1537,7 +1537,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg357, vecDir, &tr, DMG_BULLET ); break; case BULLET_PLAYER_SNIPER: - pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg357 * 1.5, vecDir, &tr, DMG_BULLET ); + pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg357 * 1.5f, vecDir, &tr, DMG_BULLET ); break; case BULLET_NONE: // FIX pEntity->TraceAttack( pevAttacker, 50, vecDir, &tr, DMG_CLUB ); diff --git a/dlls/h_battery.cpp b/dlls/h_battery.cpp index 43ce08ac..762688b6 100644 --- a/dlls/h_battery.cpp +++ b/dlls/h_battery.cpp @@ -126,7 +126,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use // if( m_flSoundTime <= gpGlobals->time ) { - m_flSoundTime = gpGlobals->time + 0.62; + m_flSoundTime = gpGlobals->time + 0.62f; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/suitchargeno1.wav", 0.85, ATTN_NORM ); } return; diff --git a/dlls/player.cpp b/dlls/player.cpp index 7b115e12..a3fe8143 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -512,7 +512,7 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl UTIL_TraceLine( pev->origin, pev->origin + Vector( 0, 0, 100 ), dont_ignore_monsters, edict(), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) pDeathCam->pev->origin.z += 100; else pDeathCam->pev->origin.z += fabs( pev->origin.z - tr.vecEndPos.z ); diff --git a/dlls/visitors/pipe.cpp b/dlls/visitors/pipe.cpp index 707bc64b..49553814 100644 --- a/dlls/visitors/pipe.cpp +++ b/dlls/visitors/pipe.cpp @@ -109,7 +109,7 @@ BOOL CPipe::Deploy() void CPipe::Holster(int skiplocal /* = 0 */) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim(PIPE_HOLSTER); } @@ -147,10 +147,10 @@ int CPipe::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 @@ -167,7 +167,7 @@ int CPipe::Swing(int fFirst) 0.0, 0, 0.0); - if (tr.flFraction >= 1.0) + if (tr.flFraction >= 1.0f) { if (fFirst) { @@ -284,7 +284,7 @@ int CPipe::Swing(int fFirst) m_pPlayer->m_iWeaponVolume = flVol * PIPE_WALLHIT_VOLUME; SetThink(&CPipe::Smack); - pev->nextthink = UTIL_WeaponTimeBase() + 0.48; + pev->nextthink = UTIL_WeaponTimeBase() + 0.48f; #endif m_flNextPrimaryAttack = GetNextAttackDelay(0.5f); // 0.25f } @@ -301,22 +301,22 @@ void CPipe::WeaponIdle() { int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand > 0.9 ) + if( flRand > 0.9f ) { iAnim = PIPE_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 = PIPE_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f; } else { iAnim = PIPE_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; } } SendWeaponAnim( iAnim ); diff --git a/dlls/visitors/sniper.cpp b/dlls/visitors/sniper.cpp index c1fa23e3..8848fb69 100644 --- a/dlls/visitors/sniper.cpp +++ b/dlls/visitors/sniper.cpp @@ -107,7 +107,7 @@ void CSniper::Holster(int skiplocal /* = 0 */) SecondaryAttack(); } - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; m_flTimeWeaponIdle = UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15); } @@ -124,7 +124,7 @@ void CSniper::SecondaryAttack(void) m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 40; } - m_flNextSecondaryAttack = 0.75; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75f; EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_STATIC, "weapons/zoom.wav", 1, ATTN_NORM, 0, RANDOM_LONG( 100, 150 ) ); } @@ -137,14 +137,14 @@ void CSniper::PrimaryAttack() if (m_pPlayer->pev->waterlevel == 3) { PlayEmptySound(); - m_flNextPrimaryAttack = m_flNextSecondaryAttack = 0.15; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } if (m_iClip <= 0) { PlayEmptySound(); - m_flNextPrimaryAttack = m_flNextSecondaryAttack = 0.2; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2f; return; } @@ -177,17 +177,17 @@ void CSniper::PrimaryAttack() PLAYBACK_EVENT_FULL(flags, m_pPlayer->edict(), m_usFireSniper, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0); if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] > 0 || m_iClip > 0 ) - m_flNextPrimaryAttack = 1.5; + m_flNextPrimaryAttack = 1.5f; else { - m_flNextPrimaryAttack = 2.75; - m_flNextSecondaryAttack = 0.75; + m_flNextPrimaryAttack = 2.75f; + m_flNextSecondaryAttack = 0.75f; } if( m_iClip > 0 ) - m_flTimeWeaponIdle = 2.5; + m_flTimeWeaponIdle = 2.5f; else - m_flTimeWeaponIdle = 1.75; + m_flTimeWeaponIdle = 1.75f; } diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 85a6cf6b..fdfdf70c 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -651,7 +651,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) } else { - m_flNextPrimaryAttack = ( UseDecrement() ? 0.0 : gpGlobals->time ) + 0.2f; + m_flNextPrimaryAttack = ( UseDecrement() ? 0.0f : gpGlobals->time ) + 0.2f; } } else if( ( m_pPlayer->pev->button & IN_ATTACK ) && CanAttack( m_flNextPrimaryAttack, gpGlobals->time, UseDecrement() ) )