More double promotion fixes.

This commit is contained in:
Andrey Akhmichin 2019-10-13 17:12:41 +05:00
parent ec9bffedaf
commit 73397679c2
10 changed files with 20 additions and 20 deletions

View File

@ -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;
}

View File

@ -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 );

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 )
{

View File

@ -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 )
{

View File

@ -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.