From e3fbac5a64caa0b51bc01d4a71e76b54b746d555 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Thu, 2 Jan 2020 22:31:26 +0500 Subject: [PATCH] Double promotion fixes. --- dlls/rp/blkop_apache.cpp | 2 +- dlls/rp/blkop_osprey.cpp | 2 +- dlls/rp/fgrunt.cpp | 2 +- dlls/rp/gonome.cpp | 12 ++++++------ dlls/rp/massn.cpp | 2 +- dlls/rp/ngrunt.cpp | 2 +- dlls/rp/otis.cpp | 2 +- dlls/rp/pitdrone.cpp | 14 +++++++------- dlls/rp/zgrunt.cpp | 2 +- dlls/scientist.cpp | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dlls/rp/blkop_apache.cpp b/dlls/rp/blkop_apache.cpp index d40b23ea..14dd029e 100644 --- a/dlls/rp/blkop_apache.cpp +++ b/dlls/rp/blkop_apache.cpp @@ -68,7 +68,7 @@ void CBlkopApache::Spawn(void) { SetThink(&CApache::HuntThink); SetTouch(&CApache::FlyTouch); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } m_iRockets = 10; diff --git a/dlls/rp/blkop_osprey.cpp b/dlls/rp/blkop_osprey.cpp index b7d76249..4e97dacc 100644 --- a/dlls/rp/blkop_osprey.cpp +++ b/dlls/rp/blkop_osprey.cpp @@ -67,7 +67,7 @@ void CBlkopOsprey::Spawn(void) if (!(pev->spawnflags & SF_WAITFORTRIGGER)) { - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } m_pos2 = pev->origin; diff --git a/dlls/rp/fgrunt.cpp b/dlls/rp/fgrunt.cpp index bcb8ea03..bd6ae94a 100644 --- a/dlls/rp/fgrunt.cpp +++ b/dlls/rp/fgrunt.cpp @@ -963,7 +963,7 @@ void CFGruntRepel::RepelUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetColor( 255, 255, 255 ); pBeam->SetThink( &CBaseEntity::SUB_Remove ); - pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pGrunt->pev->velocity.z + 0.5f; UTIL_Remove( this ); } diff --git a/dlls/rp/gonome.cpp b/dlls/rp/gonome.cpp index aa52c232..e23b9715 100644 --- a/dlls/rp/gonome.cpp +++ b/dlls/rp/gonome.cpp @@ -95,7 +95,7 @@ void CGonomeGuts::Shoot( entvars_t *pevOwner, Vector vecStart, Vector vecVelocit pSpit->pev->owner = ENT( pevOwner ); pSpit->SetThink( &CSquidSpit::Animate ); - pSpit->pev->nextthink = gpGlobals->time + 0.1; + pSpit->pev->nextthink = gpGlobals->time + 0.1f; } void CGonomeGuts::Touch( CBaseEntity *pOther ) @@ -333,7 +333,7 @@ BOOL CGonome::CheckRangeAttack1(float flDot, float flDist) return FALSE; } - if (flDist > 64 && flDist <= 784 && flDot >= 0.5 && gpGlobals->time >= m_flNextSpitTime) + if (flDist > 64 && flDist <= 784 && flDot >= 0.5f && gpGlobals->time >= m_flNextSpitTime) { if (m_hEnemy != 0) { @@ -347,12 +347,12 @@ BOOL CGonome::CheckRangeAttack1(float flDot, float flDist) if (IsMoving()) { // don't spit again for a long time, resume chasing enemy. - m_flNextSpitTime = gpGlobals->time + 5; + m_flNextSpitTime = gpGlobals->time + 5.0f; } else { // not moving, so spit again pretty soon. - m_flNextSpitTime = gpGlobals->time + 0.5; + m_flNextSpitTime = gpGlobals->time + 0.5f; } return TRUE; @@ -367,7 +367,7 @@ BOOL CGonome::CheckRangeAttack1(float flDot, float flDist) //========================================================= BOOL CGonome::CheckMeleeAttack1(float flDot, float flDist) { - if( m_hEnemy->pev->health <= gSkillData.gonomeDmgOneSlash && flDist <= 85 && flDot >= 0.7 ) + if( m_hEnemy->pev->health <= gSkillData.gonomeDmgOneSlash && flDist <= 85 && flDot >= 0.7f ) { return TRUE; } @@ -379,7 +379,7 @@ BOOL CGonome::CheckMeleeAttack1(float flDot, float flDist) //========================================================= BOOL CGonome::CheckMeleeAttack2(float flDot, float flDist) { - if( flDist <= 85 && flDot >= 0.7 && !HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) ) // The player & bullsquid can be as much as their bboxes + if( flDist <= 85 && flDot >= 0.7f && !HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) ) // The player & bullsquid can be as much as their bboxes { // apart (48 * sqrt(3)) and he can still attack (85 is a little more than 48*sqrt(3)) return TRUE; } diff --git a/dlls/rp/massn.cpp b/dlls/rp/massn.cpp index 83be8899..1258af71 100644 --- a/dlls/rp/massn.cpp +++ b/dlls/rp/massn.cpp @@ -396,7 +396,7 @@ void CAssassinRepel::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 / pGrunt->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pGrunt->pev->velocity.z + 0.5f; UTIL_Remove(this); } diff --git a/dlls/rp/ngrunt.cpp b/dlls/rp/ngrunt.cpp index 1f4c5845..a4c96bc5 100644 --- a/dlls/rp/ngrunt.cpp +++ b/dlls/rp/ngrunt.cpp @@ -930,7 +930,7 @@ void CNGruntRepel::RepelUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetColor( 255, 255, 255 ); pBeam->SetThink( &CBaseEntity::SUB_Remove ); - pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pGrunt->pev->velocity.z + 0.5f; UTIL_Remove( this ); } diff --git a/dlls/rp/otis.cpp b/dlls/rp/otis.cpp index 46089a6c..fb3a446b 100644 --- a/dlls/rp/otis.cpp +++ b/dlls/rp/otis.cpp @@ -279,7 +279,7 @@ static BOOL IsFacing(entvars_t *pevTest, const Vector &reference) angle.x = 0; 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/rp/pitdrone.cpp b/dlls/rp/pitdrone.cpp index c5c8319e..1c3553e7 100644 --- a/dlls/rp/pitdrone.cpp +++ b/dlls/rp/pitdrone.cpp @@ -89,7 +89,7 @@ void CPitDroneSpit::Touch(CBaseEntity *pOther) pev->velocity = Vector(0, 0, 0); pev->avelocity.z = 0; pev->angles.z = RANDOM_LONG(0, 360); - pev->nextthink = gpGlobals->time + 10.0; + pev->nextthink = gpGlobals->time + 10.0f; } } else @@ -311,7 +311,7 @@ int CPitDrone::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float { flDist = (pev->origin - m_Route[m_iRouteIndex].vecLocation).Length2D();// reusing flDist. - if (FTriangulate(pev->origin, m_Route[m_iRouteIndex].vecLocation, flDist * 0.5, m_hEnemy, &vecApex)) + if (FTriangulate(pev->origin, m_Route[m_iRouteIndex].vecLocation, flDist * 0.5f, m_hEnemy, &vecApex)) { InsertWaypoint(vecApex, bits_MF_TO_DETOUR | bits_MF_DONT_SIMPLIFY); } @@ -349,18 +349,18 @@ BOOL CPitDrone::CheckRangeAttack1(float flDot, float flDist) return FALSE; } - if (flDist > 64 && flDist <= 784 && flDot >= 0.5 && gpGlobals->time >= m_flNextSpitTime) + if (flDist > 64 && flDist <= 784 && flDot >= 0.5f && gpGlobals->time >= m_flNextSpitTime) { if (IsMoving()) { // don't spit again for a long time, resume chasing enemy. - m_flNextSpitTime = gpGlobals->time + 5; + m_flNextSpitTime = gpGlobals->time + 5.0f; } else { // not moving, so spit again pretty soon. - m_flNextSpitTime = gpGlobals->time + 0.5; + m_flNextSpitTime = gpGlobals->time + 0.5f; } return TRUE; @@ -490,8 +490,8 @@ void CPitDrone::HandleAnimEvent(MonsterEvent_t *pEvent) } // jump into air for 0.8 (24/30) seconds - //pev->velocity.z += ( 0.875 * flGravity ) * 0.5; - pev->velocity.z += ( 0.625 * flGravity ) * 0.5; + //pev->velocity.z += ( 0.875f * flGravity ) * 0.5f; + pev->velocity.z += ( 0.625f * flGravity ) * 0.5f; } break; diff --git a/dlls/rp/zgrunt.cpp b/dlls/rp/zgrunt.cpp index 997c9317..8503cc00 100644 --- a/dlls/rp/zgrunt.cpp +++ b/dlls/rp/zgrunt.cpp @@ -981,7 +981,7 @@ void CZGruntRepel::RepelUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetColor( 255, 255, 255 ); pBeam->SetThink( &CBaseEntity::SUB_Remove ); - pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pGrunt->pev->velocity.z + 0.5f; UTIL_Remove( this ); } diff --git a/dlls/scientist.cpp b/dlls/scientist.cpp index 29291b44..c721ccad 100644 --- a/dlls/scientist.cpp +++ b/dlls/scientist.cpp @@ -1080,7 +1080,7 @@ BOOL CScientist::CanHeal( void ) if( FClassnameIs( pev, "monster_cleansuit_scientist" ) ) return FALSE; - if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == 0 ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5 ) ) ) + if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == 0 ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5f ) ) ) return FALSE; return TRUE;