Double promotion fixes.

This commit is contained in:
Andrey Akhmichin 2020-01-03 01:06:00 +05:00
parent 340054225a
commit 02ee5fe4f6
6 changed files with 23 additions and 23 deletions

View File

@ -1537,7 +1537,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi
pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg357, vecDir, &tr, DMG_BULLET ); pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg357, vecDir, &tr, DMG_BULLET );
break; break;
case BULLET_PLAYER_SNIPER: 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; break;
case BULLET_NONE: // FIX case BULLET_NONE: // FIX
pEntity->TraceAttack( pevAttacker, 50, vecDir, &tr, DMG_CLUB ); pEntity->TraceAttack( pevAttacker, 50, vecDir, &tr, DMG_CLUB );

View File

@ -126,7 +126,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
// //
if( m_flSoundTime <= gpGlobals->time ) 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 ); EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/suitchargeno1.wav", 0.85, ATTN_NORM );
} }
return; return;

View File

@ -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 ); 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; pDeathCam->pev->origin.z += 100;
else else
pDeathCam->pev->origin.z += fabs( pev->origin.z - tr.vecEndPos.z ); pDeathCam->pev->origin.z += fabs( pev->origin.z - tr.vecEndPos.z );

View File

@ -109,7 +109,7 @@ BOOL CPipe::Deploy()
void CPipe::Holster(int skiplocal /* = 0 */) 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); SendWeaponAnim(PIPE_HOLSTER);
} }
@ -147,10 +147,10 @@ int CPipe::Swing(int fFirst)
UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(m_pPlayer->pev), &tr); UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(m_pPlayer->pev), &tr);
#ifndef CLIENT_DLL #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); 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 // Calculate the point of intersection of the line (or hull) and the object we hit
// This is and approximation of the "best" intersection // This is and approximation of the "best" intersection
@ -167,7 +167,7 @@ int CPipe::Swing(int fFirst)
0.0, 0, 0.0); 0.0, 0, 0.0);
if (tr.flFraction >= 1.0) if (tr.flFraction >= 1.0f)
{ {
if (fFirst) if (fFirst)
{ {
@ -284,7 +284,7 @@ int CPipe::Swing(int fFirst)
m_pPlayer->m_iWeaponVolume = flVol * PIPE_WALLHIT_VOLUME; m_pPlayer->m_iWeaponVolume = flVol * PIPE_WALLHIT_VOLUME;
SetThink(&CPipe::Smack); SetThink(&CPipe::Smack);
pev->nextthink = UTIL_WeaponTimeBase() + 0.48; pev->nextthink = UTIL_WeaponTimeBase() + 0.48f;
#endif #endif
m_flNextPrimaryAttack = GetNextAttackDelay(0.5f); // 0.25f m_flNextPrimaryAttack = GetNextAttackDelay(0.5f); // 0.25f
} }
@ -301,22 +301,22 @@ void CPipe::WeaponIdle()
{ {
int iAnim; int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
if( flRand > 0.9 ) if( flRand > 0.9f )
{ {
iAnim = PIPE_IDLE2; iAnim = PIPE_IDLE2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f;
} }
else else
{ {
if( flRand > 0.5 ) if( flRand > 0.5f )
{ {
iAnim = PIPE_IDLE1; iAnim = PIPE_IDLE1;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 30.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f;
} }
else else
{ {
iAnim = PIPE_IDLE3; iAnim = PIPE_IDLE3;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f;
} }
} }
SendWeaponAnim( iAnim ); SendWeaponAnim( iAnim );

View File

@ -107,7 +107,7 @@ void CSniper::Holster(int skiplocal /* = 0 */)
SecondaryAttack(); 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); 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_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 ) ); 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) if (m_pPlayer->pev->waterlevel == 3)
{ {
PlayEmptySound(); PlayEmptySound();
m_flNextPrimaryAttack = m_flNextSecondaryAttack = 0.15; m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return; return;
} }
if (m_iClip <= 0) if (m_iClip <= 0)
{ {
PlayEmptySound(); PlayEmptySound();
m_flNextPrimaryAttack = m_flNextSecondaryAttack = 0.2; m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2f;
return; 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); 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 ) if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] > 0 || m_iClip > 0 )
m_flNextPrimaryAttack = 1.5; m_flNextPrimaryAttack = 1.5f;
else else
{ {
m_flNextPrimaryAttack = 2.75; m_flNextPrimaryAttack = 2.75f;
m_flNextSecondaryAttack = 0.75; m_flNextSecondaryAttack = 0.75f;
} }
if( m_iClip > 0 ) if( m_iClip > 0 )
m_flTimeWeaponIdle = 2.5; m_flTimeWeaponIdle = 2.5f;
else else
m_flTimeWeaponIdle = 1.75; m_flTimeWeaponIdle = 1.75f;
} }

View File

@ -651,7 +651,7 @@ void CBasePlayerWeapon::ItemPostFrame( void )
} }
else 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() ) ) else if( ( m_pPlayer->pev->button & IN_ATTACK ) && CanAttack( m_flNextPrimaryAttack, gpGlobals->time, UseDecrement() ) )