From 73397679c2be8794466d2396d6f53a1fd0d5609c Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 13 Oct 2019 17:12:41 +0500 Subject: [PATCH] More double promotion fixes. --- cl_dll/MOTD.cpp | 4 ++-- cl_dll/ammo.cpp | 2 +- cl_dll/ammo_secondary.cpp | 2 +- cl_dll/battery.cpp | 2 +- cl_dll/health.cpp | 2 +- cl_dll/hl/hl_weapons.cpp | 14 +++++++------- cl_dll/scoreboard.cpp | 6 +++--- dlls/apache.cpp | 2 +- dlls/ggrenade.cpp | 2 +- dlls/zombie.cpp | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cl_dll/MOTD.cpp b/cl_dll/MOTD.cpp index 439fb9c4..7059948a 100644 --- a/cl_dll/MOTD.cpp +++ b/cl_dll/MOTD.cpp @@ -80,9 +80,9 @@ int CHudMOTD::Draw( float fTime ) { ypos = ROW_RANGE_MIN + 7 + scroll; if( ypos > ROW_RANGE_MIN + 4 ) - scroll-= ( ypos - ( ROW_RANGE_MIN + 4 ) ) / 3.0; + scroll-= ( ypos - ( ROW_RANGE_MIN + 4 ) ) / 3.0f; if( ypos + height < ROW_RANGE_MAX ) - scroll+= ( ROW_RANGE_MAX - ( ypos + height ) ) / 3.0; + scroll+= ( ROW_RANGE_MAX - ( ypos + height ) ) / 3.0f; ypos_r = ROW_RANGE_MIN; height = ROW_RANGE_MAX; } diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index c6aabfba..7be34e23 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -864,7 +864,7 @@ int CHudAmmo::Draw( float flTime ) a = (int)Q_max( MIN_ALPHA, m_fFade ); if( m_fFade > 0 ) - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); UnpackRGB( r, g, b, RGB_YELLOWISH ); diff --git a/cl_dll/ammo_secondary.cpp b/cl_dll/ammo_secondary.cpp index 786f862d..4034c86f 100644 --- a/cl_dll/ammo_secondary.cpp +++ b/cl_dll/ammo_secondary.cpp @@ -63,7 +63,7 @@ int CHudAmmoSecondary::Draw( float flTime ) UnpackRGB( r, g, b, RGB_YELLOWISH ); a = (int)Q_max( MIN_ALPHA, m_fFade ); if( m_fFade > 0 ) - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); // slowly lower alpha to fade out icons + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); // slowly lower alpha to fade out icons ScaleColors( r, g, b, a ); AmmoWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left; diff --git a/cl_dll/battery.cpp b/cl_dll/battery.cpp index 7933dd6b..b6cd9e0b 100644 --- a/cl_dll/battery.cpp +++ b/cl_dll/battery.cpp @@ -91,7 +91,7 @@ int CHudBattery::Draw( float flTime ) if( m_fFade > FADE_TIME ) m_fFade = FADE_TIME; - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); if( m_fFade <= 0 ) { a = 128; diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index 10dc15af..998b4829 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -191,7 +191,7 @@ int CHudHealth::Draw( float flTime ) // Has health changed? Flash the health # if( m_fFade ) { - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); if( m_fFade <= 0 ) { a = MIN_ALPHA; diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 8c1489fe..63e6f6d8 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -163,7 +163,7 @@ BOOL CBasePlayerWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay, i m_fInReload = TRUE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; return TRUE; } @@ -944,12 +944,12 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm pto->iuser3 = pCurrent->m_fireState; // Decrement weapon counters, server does this at same time ( during post think, after doing everything else ) - pto->m_flNextReload -= cmd->msec / 1000.0; - pto->m_fNextAimBonus -= cmd->msec / 1000.0; - pto->m_flNextPrimaryAttack -= cmd->msec / 1000.0; - pto->m_flNextSecondaryAttack -= cmd->msec / 1000.0; - pto->m_flTimeWeaponIdle -= cmd->msec / 1000.0; - pto->fuser1 -= cmd->msec / 1000.0; + pto->m_flNextReload -= cmd->msec / 1000.0f; + pto->m_fNextAimBonus -= cmd->msec / 1000.0f; + pto->m_flNextPrimaryAttack -= cmd->msec / 1000.0f; + pto->m_flNextSecondaryAttack -= cmd->msec / 1000.0f; + pto->m_flTimeWeaponIdle -= cmd->msec / 1000.0f; + pto->fuser1 -= cmd->msec / 1000.0f; to->client.vuser3[2] = pCurrent->m_iSecondaryAmmoType; to->client.vuser4[0] = pCurrent->m_iPrimaryAmmoType; diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index 3361aa0a..721980f3 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -171,12 +171,12 @@ int CHudScoreboard::Draw( float fTime ) DrawUtfString( PL_RANGE_MAX + xpos_rel - 35, ypos, ScreenWidth, "pkt loss", 255, 140, 0 ); } - list_slot += 1.2; + list_slot += 1.2f; ypos = ROW_RANGE_MIN + ( list_slot * ROW_GAP ); // xpos = NAME_RANGE_MIN + xpos_rel; FillRGBA( xpos - 4, ypos, FAR_RIGHT -2, 1, 255, 140, 0, 255 ); // draw the seperator line - list_slot += 0.8; + list_slot += 0.8f; if( !gHUD.m_Teamplay ) { @@ -328,7 +328,7 @@ int CHudScoreboard::Draw( float fTime ) } // draw all the players who are not in a team - list_slot += 0.5; + list_slot += 0.5f; DrawPlayers( xpos_rel, list_slot, 0, "" ); return 1; diff --git a/dlls/apache.cpp b/dlls/apache.cpp index 669724db..a863e3c2 100644 --- a/dlls/apache.cpp +++ b/dlls/apache.cpp @@ -668,7 +668,7 @@ void CApache::Flight( void ) { // ALERT( at_console, "F " ); // lean forward - pev->avelocity.x -= 12.0; + pev->avelocity.x -= 12.0f; } else if( flDist < 0.0f && flSpeed > -50.0f && pev->angles.x + pev->avelocity.x < 20.0f ) { diff --git a/dlls/ggrenade.cpp b/dlls/ggrenade.cpp index f50abe98..60b658b9 100644 --- a/dlls/ggrenade.cpp +++ b/dlls/ggrenade.cpp @@ -243,7 +243,7 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) // or thrown very far tend to slow down too quickly for me to always catch just by testing velocity. // trimming the Z velocity a bit seems to help quite a bit. vecTestVelocity = pev->velocity; - vecTestVelocity.z *= 0.45; + vecTestVelocity.z *= 0.45f; if( !m_fRegisteredSound && vecTestVelocity.Length() <= 60 ) { diff --git a/dlls/zombie.cpp b/dlls/zombie.cpp index 96f032e6..7f891a36 100644 --- a/dlls/zombie.cpp +++ b/dlls/zombie.cpp @@ -136,11 +136,11 @@ int CZombie::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float // Take 30% damage from bullets if( bitsDamageType == DMG_BULLET ) { - Vector vecDir = pev->origin - (pevInflictor->absmin + pevInflictor->absmax) * 0.5; + Vector vecDir = pev->origin - ( pevInflictor->absmin + pevInflictor->absmax ) * 0.5f; vecDir = vecDir.Normalize(); float flForce = DamageForce( flDamage ); pev->velocity = pev->velocity + vecDir * flForce; - flDamage *= 0.3; + flDamage *= 0.3f; } // HACK HACK -- until we fix this.