Double promotion fixes.

This commit is contained in:
Andrey Akhmichin 2020-01-11 03:51:45 +05:00
parent 3148e9aec3
commit 5c07a90490
25 changed files with 226 additions and 227 deletions

View File

@ -638,7 +638,7 @@ void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int
tracer = EV_HLDM_CheckTracer( idx, vecSrc, tr.endpos, forward, right, iBulletType, iTracerFreq, tracerCount );
// do damage, paint decals
if( tr.fraction != 1.0 )
if( tr.fraction != 1.0f )
{
switch( iBulletType )
{

View File

@ -1044,7 +1044,7 @@ void StartFrame( void )
// END BOT
// START BOT
if( ( g_fGameOver ) && ( respawn_time < 1.0 ) )
if( ( g_fGameOver ) && ( respawn_time < 1.0f ) )
{
// if the game is over (time/frag limit) set the respawn time...
respawn_time = 5.0;
@ -1067,7 +1067,7 @@ void StartFrame( void )
// check if a map was changed via "map" without kicking bots...
if( previous_time > gpGlobals->time )
{
bot_check_time = gpGlobals->time + 10.0;
bot_check_time = gpGlobals->time + 10.0f;
for( index = 0; index < 32; index++ )
{
@ -1078,18 +1078,18 @@ void StartFrame( void )
bot_respawn[index].state = BOT_NEED_TO_RESPAWN;
// if the map was changed set the respawn time...
respawn_time = 5.0;
respawn_time = 5.0f;
}
}
}
// is new game started and time to respawn bots yet?
if( ( !g_fGameOver ) && ( respawn_time > 1.0 ) &&
if( ( !g_fGameOver ) && ( respawn_time > 1.0f ) &&
( gpGlobals->time >= respawn_time ) )
{
index = 0;
bot_check_time = gpGlobals->time + 5.0;
bot_check_time = gpGlobals->time + 5.0f;
// find bot needing to be respawned...
while( ( index < 32 ) &&
( bot_respawn[index].state != BOT_NEED_TO_RESPAWN ) )
@ -1105,11 +1105,11 @@ void StartFrame( void )
bot_respawn[index].name,
bot_respawn[index].skill);
respawn_time = gpGlobals->time + 1.0; // set next respawn time
respawn_time = gpGlobals->time + 1.0f; // set next respawn time
}
else
{
respawn_time = 0.0;
respawn_time = 0.0f;
}
}
// END BOT
@ -1282,7 +1282,7 @@ void StartFrame( void )
// if time to check for server commands then do so...
if( check_server_cmd <= gpGlobals->time )
{
check_server_cmd = gpGlobals->time + 1.0;
check_server_cmd = gpGlobals->time + 1.0f;
const char *cvar_bot = CVAR_GET_STRING( "bot" );
@ -1377,7 +1377,7 @@ void StartFrame( void )
if( bot_check_time < gpGlobals->time )
{
int count = 0;
bot_check_time = gpGlobals->time + 5.0;
bot_check_time = gpGlobals->time + 5.0f;
for( i = 1; i <= gpGlobals->maxClients; i++ )
{

View File

@ -319,7 +319,7 @@ BOOL CCrossbow::Deploy()
return DefaultDeploy( "models/v_crossbow.mdl", "models/p_crossbow.mdl", CROSSBOW_DRAW, "bow" );
SetThink(&CCrossbow::ZoomThink);
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}
void CCrossbow::Holster( int skiplocal /* = 0 */ )
@ -538,7 +538,7 @@ void CCrossbow::ZoomThink()
m_pPlayer->m_iFOV = 90;
NowZooming = false;
ZoomStopped = false;
pev->nextthink = gpGlobals->time + 0.25;
pev->nextthink = gpGlobals->time + 0.25f;
return;
}
}
@ -563,7 +563,7 @@ void CCrossbow::ZoomThink()
}
// Stell den n hsten Durchlauf ein
pev->nextthink = gpGlobals->time + 0.05;
pev->nextthink = gpGlobals->time + 0.05f;
}
void CCrossbow::WeaponIdle( void )

View File

@ -2039,7 +2039,7 @@ void CBasePlayer::PreThink( void )
UTIL_MakeVectors( pev->v_angle );
UTIL_TraceLine( pev->origin + pev->view_ofs,pev->origin + pev->view_ofs + gpGlobals->v_forward * 1300,dont_ignore_monsters, edict(), &tr );
if( tr.flFraction != 1.0 && !FNullEnt( tr.pHit ) )
if( tr.flFraction != 1.0f && !FNullEnt( tr.pHit ) )
{
// if we hit something, get an instance of it
pEnemy = CBaseEntity::Instance( tr.pHit );
@ -2078,7 +2078,7 @@ void CBasePlayer::PreThink( void )
}
UTIL_HudMessage(this, hText, szEnemy); // diplay message
m_flNextNameDisplay = gpGlobals->time + 0.5; // show next name in 0.5 sec
m_flNextNameDisplay = gpGlobals->time + 0.5f; // show next name in 0.5 sec
}
}
int buttonsChanged = ( m_afButtonLast ^ pev->button ); // These buttons have changed this frame

View File

@ -251,7 +251,7 @@ void CRpgRocket::RocketTouch( CBaseEntity *pOther )
pev->effects |= EF_NODRAW; // stop showing the model!!
pev->velocity = g_vecZero; // set velocity to "0"
SetThink( &CRpgRocket::AfterGlow );
pev->nextthink = gpGlobals->time +.7; // set next think into future
pev->nextthink = gpGlobals->time + 0.7f; // set next think into future
}
void CRpgRocket::AfterGlow( void )

View File

@ -110,14 +110,14 @@ void Cak47::PrimaryAttack()
if (m_pPlayer->pev->waterlevel == 3 && m_pPlayer->pev->watertype > CONTENT_FLYFIELD)
{
PlayEmptySound( );
m_flNextPrimaryAttack = 0.15;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return;
}
if (m_iClip <= 0)
{
PlayEmptySound();
m_flNextPrimaryAttack = 0.15;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return;
}
@ -164,10 +164,10 @@ void Cak47::PrimaryAttack()
// HEV suit - indicate out of ammo condition
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + GetNextAttackDelay( 0.1 );
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + GetNextAttackDelay( 0.1f );
if ( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() )
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}
@ -234,10 +234,10 @@ void Cak47::SecondaryAttack( void )
// HEV suit - indicate out of ammo condition
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
m_flNextSecondaryAttack = GetNextAttackDelay( 0.3 );
m_flNextSecondaryAttack = GetNextAttackDelay( 0.3f );
if ( m_flNextSecondaryAttack < UTIL_WeaponTimeBase() )
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}

View File

@ -202,7 +202,7 @@ void CApache_bo::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_
void CApache_bo :: Killed( entvars_t *pevAttacker, int iGib )
{
pev->movetype = MOVETYPE_TOSS;
pev->gravity = 0.3;
pev->gravity = 0.3f;
STOP_SOUND( ENT(pev), CHAN_STATIC, "apache/ap_rotor2.wav" );
@ -215,11 +215,11 @@ void CApache_bo :: Killed( entvars_t *pevAttacker, int iGib )
if (pev->spawnflags & SF_NOWRECKAGE)
{
m_flNextRocket = gpGlobals->time + 4.0;
m_flNextRocket = gpGlobals->time + 4.0f;
}
else
{
m_flNextRocket = gpGlobals->time + 15.0;
m_flNextRocket = gpGlobals->time + 15.0f;
}
}
@ -228,7 +228,7 @@ void CApache_bo :: DyingThink( void )
StudioFrameAdvance( );
SetNextThink( 0.1 );
pev->avelocity = pev->avelocity * 1.02;
pev->avelocity = pev->avelocity * 1.02f;
// still falling?
if (m_flNextRocket > gpGlobals->time )
@ -256,7 +256,7 @@ void CApache_bo :: DyingThink( void )
WRITE_BYTE( 10 ); // framerate
MESSAGE_END();
Vector vecSpot = pev->origin + (pev->mins + pev->maxs) * 0.5;
Vector vecSpot = pev->origin + (pev->mins + pev->maxs) * 0.5f;
MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot );
WRITE_BYTE( TE_BREAKMODEL);
@ -294,12 +294,12 @@ void CApache_bo :: DyingThink( void )
// don't stop it we touch a entity
pev->flags &= ~FL_ONGROUND;
SetNextThink( 0.2 );
SetNextThink( 0.2f );
return;
}
else
{
Vector vecSpot = pev->origin + (pev->mins + pev->maxs) * 0.5;
Vector vecSpot = pev->origin + (pev->mins + pev->maxs) * 0.5f;
/*
MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY );
@ -373,7 +373,7 @@ void CApache_bo :: DyingThink( void )
}
// gibs
vecSpot = pev->origin + (pev->mins + pev->maxs) * 0.5;
vecSpot = pev->origin + (pev->mins + pev->maxs) * 0.5f;
MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot );
WRITE_BYTE( TE_BREAKMODEL);
@ -410,7 +410,7 @@ void CApache_bo :: DyingThink( void )
MESSAGE_END();
SetThink(&CApache_bo :: SUB_Remove );
SetNextThink( 0.1 );
SetNextThink( 0.1f );
}
}
@ -518,9 +518,9 @@ void CApache_bo :: HuntThink( void )
if (flLength > 250) // 500
{
// float flLength2 = (m_posTarget - pev->origin).Length() * (1.5 - DotProduct((m_posTarget - pev->origin).Normalize(), pev->velocity.Normalize() ));
// float flLength2 = (m_posTarget - pev->origin).Length() * (1.5f - DotProduct((m_posTarget - pev->origin).Normalize(), pev->velocity.Normalize() ));
// if (flLength2 < flLength)
if (m_flLastSeen + 90 > gpGlobals->time && DotProduct( (m_posTarget - pev->origin).Normalize(), (m_posDesired - pev->origin).Normalize( )) > 0.25)
if (m_flLastSeen + 90 > gpGlobals->time && DotProduct( (m_posTarget - pev->origin).Normalize(), (m_posDesired - pev->origin).Normalize( )) > 0.25f)
{
m_vecDesired = (m_posTarget - pev->origin).Normalize( );
}
@ -548,7 +548,7 @@ void CApache_bo :: HuntThink( void )
// don't fire rockets and gun on easy mode
if (g_iSkillLevel == SKILL_EASY)
m_flNextRocket = gpGlobals->time + 10.0;
m_flNextRocket = gpGlobals->time + 10.0f;
}
UTIL_MakeAimVectors( pev->angles );
@ -558,7 +558,7 @@ void CApache_bo :: HuntThink( void )
if ((m_iRockets % 2) == 1)
{
FireRocket( );
m_flNextRocket = gpGlobals->time + 0.5;
m_flNextRocket = gpGlobals->time + 0.5f;
if (m_iRockets <= 0)
{
m_flNextRocket = gpGlobals->time + 10;
@ -572,7 +572,7 @@ void CApache_bo :: HuntThink( void )
if (m_hEnemy != 0)
{
// make sure it's a good shot
if (DotProduct( m_vecTarget, vecEst) > .965)
if (DotProduct( m_vecTarget, vecEst) > 0.965f)
{
TraceResult tr;
@ -625,7 +625,7 @@ void CApache_bo :: Flight( void )
// estimate where I'll be in two seconds
UTIL_MakeAimVectors( pev->angles + pev->avelocity * 1 + vecAdj);
Vector vecEst = pev->origin + pev->velocity * 2.0 + gpGlobals->v_up * m_flForce * 20 - Vector( 0, 0, 384 * 2 );
Vector vecEst = pev->origin + pev->velocity * 2.0f + gpGlobals->v_up * m_flForce * 20 - Vector( 0, 0, 384 * 2 );
// add immediate force
UTIL_MakeAimVectors( pev->angles + vecAdj);
@ -633,7 +633,7 @@ void CApache_bo :: Flight( void )
pev->velocity.y += gpGlobals->v_up.y * m_flForce;
pev->velocity.z += gpGlobals->v_up.z * m_flForce;
// add gravity
pev->velocity.z -= 38.4; // 32ft/sec
pev->velocity.z -= 38.4f; // 32ft/sec
float flSpeed = pev->velocity.Length();
@ -664,12 +664,12 @@ void CApache_bo :: Flight( void )
}
// sideways drag
pev->velocity.x = pev->velocity.x * (1.0 - fabs( gpGlobals->v_right.x ) * 0.05);
pev->velocity.y = pev->velocity.y * (1.0 - fabs( gpGlobals->v_right.y ) * 0.05);
pev->velocity.z = pev->velocity.z * (1.0 - fabs( gpGlobals->v_right.z ) * 0.05);
pev->velocity.x = pev->velocity.x * (1.0f - fabs( gpGlobals->v_right.x ) * 0.05f);
pev->velocity.y = pev->velocity.y * (1.0f - fabs( gpGlobals->v_right.y ) * 0.05f);
pev->velocity.z = pev->velocity.z * (1.0f - fabs( gpGlobals->v_right.z ) * 0.05f);
// general drag
pev->velocity = pev->velocity * 0.995;
pev->velocity = pev->velocity * 0.995f;
// apply power to stay correct height
if (m_flForce < 80 && vecEst.z < m_posDesired.z)
@ -687,23 +687,23 @@ void CApache_bo :: Flight( void )
{
// ALERT( at_console, "F " );
// lean forward
pev->avelocity.x -= 12.0;
pev->avelocity.x -= 12.0f;
}
else if (flDist < 0 && flSpeed > -50 && pev->angles.x + pev->avelocity.x < 20)
{
// ALERT( at_console, "B " );
// lean backward
pev->avelocity.x += 12.0;
pev->avelocity.x += 12.0f;
}
else if (pev->angles.x + pev->avelocity.x > 0)
{
// ALERT( at_console, "f " );
pev->avelocity.x -= 4.0;
pev->avelocity.x -= 4.0f;
}
else if (pev->angles.x + pev->avelocity.x < 0)
{
// ALERT( at_console, "b " );
pev->avelocity.x += 4.0;
pev->avelocity.x += 4.0f;
}
// ALERT( at_console, "%.0f %.0f : %.0f %.0f : %.0f %.0f : %.0f\n", pev->origin.x, pev->velocity.x, flDist, flSpeed, pev->angles.x, pev->avelocity.x, m_flForce );
@ -728,7 +728,7 @@ void CApache_bo :: Flight( void )
float pitch = DotProduct( pev->velocity - pPlayer->pev->velocity, (pPlayer->pev->origin - pev->origin).Normalize() );
pitch = (int)(100 + pitch / 50.0);
pitch = (int)(100 + pitch / 50.0f);
if (pitch > 250)
pitch = 250;
@ -737,9 +737,9 @@ void CApache_bo :: Flight( void )
if (pitch == 100)
pitch = 101;
float flVol = (m_flForce / 100.0) + .1;
if (flVol > 1.0)
flVol = 1.0;
float flVol = (m_flForce / 100.0f) + 0.1f;
if (flVol > 1.0f)
flVol = 1.0f;
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0, 0.3, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch);
}
@ -752,14 +752,14 @@ void CApache_bo :: Flight( void )
void CApache_bo :: FireRocket( void )
{
static float side = 1.0;
static float side = 1.0f;
static int count;
if (m_iRockets <= 0)
return;
UTIL_MakeAimVectors( pev->angles );
Vector vecSrc = pev->origin + 1.5 * (gpGlobals->v_forward * 21 + gpGlobals->v_right * 70 * side + gpGlobals->v_up * -79);
Vector vecSrc = pev->origin + 1.5f * (gpGlobals->v_forward * 21 + gpGlobals->v_right * 70 * side + gpGlobals->v_up * -79);
switch( m_iRockets % 5)
{
@ -834,7 +834,7 @@ BOOL CApache_bo :: FireGun( )
GetAttachment( 0, posBarrel, angBarrel );
Vector vecGun = (posBarrel - posGun).Normalize( );
if (DotProduct( vecGun, vecTarget ) > 0.98)
if (DotProduct( vecGun, vecTarget ) > 0.98f)
{
#if 1
FireBullets( 1, posGun, vecGun, VECTOR_CONE_4DEGREES, 8192, BULLET_MONSTER_12MM, 1 );
@ -855,7 +855,7 @@ BOOL CApache_bo :: FireGun( )
if (flNext < gpGlobals->time)
{
flNext = gpGlobals->time + 0.5;
flNext = gpGlobals->time + 0.5f;
m_pBeam->SetStartPos( tr.vecEndPos );
}
#endif
@ -930,12 +930,12 @@ void CApache_bo::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vec
{
// ALERT( at_console, "%.0f\n", flDamage );
AddMultiDamage( pevAttacker, this, flDamage, bitsDamageType );
m_iDoSmokePuff = 3 + (flDamage / 5.0);
m_iDoSmokePuff = 3 + (flDamage / 5.0f);
}
else
{
// do half damage in the body
// AddMultiDamage( pevAttacker, this, flDamage / 2.0, bitsDamageType );
// AddMultiDamage( pevAttacker, this, flDamage / 2.0f, bitsDamageType );
UTIL_Ricochet( ptr->vecEndPos, 2.0 );
}
}

View File

@ -124,7 +124,7 @@ void CShotgunA::Holster( int skiplocal /* = 0 */ )
SecondaryAttack();
}
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f;
m_flTimeWeaponIdle = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
SendWeaponAnim( SHOTGUNA_HOLSTER );
}
@ -135,7 +135,7 @@ void CShotgunA::PrimaryAttack()
if (m_pPlayer->pev->waterlevel == 3 && m_pPlayer->pev->watertype > CONTENT_FLYFIELD)
{
PlayEmptySound( );
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.05;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.05f;
return;
}
@ -189,14 +189,14 @@ void CShotgunA::PrimaryAttack()
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
if (m_iClip != 0)
m_flPumpTime = gpGlobals->time + 0.5;
m_flPumpTime = gpGlobals->time + 0.5f;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.35;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.65;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.35f;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.65f;
if (m_iClip != 0)
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0f;
else
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f;
m_fInSpecialReload = 0;
}
@ -214,7 +214,7 @@ void CShotgunA::SecondaryAttack( void )
m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 40;
}
m_flNextSecondaryAttack = 0.5;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f;
}
@ -233,10 +233,10 @@ void CShotgunA::Reload( void )
SendWeaponAnim( SHOTGUNA_START_RELOAD );
m_fInZoom = FALSE;
m_fInSpecialReload = 1;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.6;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.0;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.6f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6f;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.0f;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f;
return;
}
else if (m_fInSpecialReload == 1)
@ -253,8 +253,8 @@ void CShotgunA::Reload( void )
SendWeaponAnim( SHOTGUNA_RELOAD );
m_flNextReload = UTIL_WeaponTimeBase() + 0.5;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5;
m_flNextReload = UTIL_WeaponTimeBase() + 0.5f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f;
}
else
{
@ -296,27 +296,27 @@ void CShotgunA::WeaponIdle( void )
// play cocking sound
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/scock1.wav", 1, ATTN_NORM, 0, 95 + RANDOM_LONG(0,0x1f));
m_fInSpecialReload = 0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5f;
}
}
else
{
int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
if (flRand <= 0.8)
if (flRand <= 0.8f)
{
iAnim = SHOTGUNA_IDLE;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + (60.0/12.0);// * RANDOM_LONG(2, 5);
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + (60.0f/12.0f);// * RANDOM_LONG(2, 5);
}
else if (flRand <= 0.95)
else if (flRand <= 0.95f)
{
iAnim = SHOTGUNA_IDLE2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + (20.0/9.0);
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + (20.0f/9.0f);
}
else
{
iAnim = SHOTGUNA_IDLE3;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + (20.0/9.0);
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + (20.0f/9.0f);
}
SendWeaponAnim( iAnim );
}

View File

@ -312,7 +312,7 @@ void CBarney_suit :: SetYawSpeed ( void )
//=========================================================
BOOL CBarney_suit :: CheckRangeAttack1 ( float flDot, float flDist )
{
if ( flDist <= 1024 && flDot >= 0.5 )
if ( flDist <= 1024 && flDot >= 0.5f )
{
if ( gpGlobals->time > m_checkAttackTime )
{
@ -323,11 +323,11 @@ BOOL CBarney_suit :: CheckRangeAttack1 ( float flDot, float flDist )
Vector shootTarget = ( (pEnemy->BodyTarget( shootOrigin ) - pEnemy->pev->origin) + m_vecEnemyLKP );
UTIL_TraceLine( shootOrigin, shootTarget, dont_ignore_monsters, ENT(pev), &tr );
m_checkAttackTime = gpGlobals->time + 1;
if ( tr.flFraction == 1.0 || (tr.pHit != NULL && CBaseEntity::Instance(tr.pHit) == pEnemy) )
if ( tr.flFraction == 1.0f || (tr.pHit != NULL && CBaseEntity::Instance(tr.pHit) == pEnemy) )
m_lastAttackCheck = TRUE;
else
m_lastAttackCheck = FALSE;
m_checkAttackTime = gpGlobals->time + 1.5;
m_checkAttackTime = gpGlobals->time + 1.5f;
}
return m_lastAttackCheck;
}
@ -545,7 +545,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;
}

View File

@ -325,7 +325,7 @@ void CBarniel :: SetYawSpeed ( void )
//=========================================================
BOOL CBarniel :: CheckRangeAttack1 ( float flDot, float flDist )
{
if ( flDist <= 1024 && flDot >= 0.5 )
if ( flDist <= 1024 && flDot >= 0.5f )
{
if ( gpGlobals->time > m_checkAttackTime )
{
@ -336,11 +336,11 @@ BOOL CBarniel :: CheckRangeAttack1 ( float flDot, float flDist )
Vector shootTarget = ( (pEnemy->BodyTarget( shootOrigin ) - pEnemy->pev->origin) + m_vecEnemyLKP );
UTIL_TraceLine( shootOrigin, shootTarget, dont_ignore_monsters, ENT(pev), &tr );
m_checkAttackTime = gpGlobals->time + 1;
if ( tr.flFraction == 1.0 || (tr.pHit != NULL && CBaseEntity::Instance(tr.pHit) == pEnemy) )
if ( tr.flFraction == 1.0f || (tr.pHit != NULL && CBaseEntity::Instance(tr.pHit) == pEnemy) )
m_lastAttackCheck = TRUE;
else
m_lastAttackCheck = FALSE;
m_checkAttackTime = gpGlobals->time + 1.5;
m_checkAttackTime = gpGlobals->time + 1.5f;
}
return m_lastAttackCheck;
}
@ -540,7 +540,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;
}

View File

@ -355,7 +355,7 @@ void CBot::Spawn( )
f_max_speed = CVAR_GET_FLOAT("sv_maxspeed");
f_speed_check_time = gpGlobals->time + 2.0;
f_speed_check_time = gpGlobals->time + 2.0f;
ladder_dir = 0;
@ -392,7 +392,7 @@ void CBot::Spawn( )
bot_model = MODEL_SCIENTIST;
}
f_pain_time = gpGlobals->time + 5.0;
f_pain_time = gpGlobals->time + 5.0f;
b_use_health_station = FALSE;
b_use_HEV_station = FALSE;
@ -466,7 +466,7 @@ int CBot::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker,
// speak pain sounds about 50% of the time
if (RANDOM_LONG(1, 100) <= 50)
{
f_pain_time = gpGlobals->time + 5.0;
f_pain_time = gpGlobals->time + 5.0f;
if (bot_model == MODEL_HGRUNT)
strcpy( sound, hgrunt_sounds[RANDOM_LONG(0,4)] );
@ -561,7 +561,7 @@ BOOL CBot::BotEntityIsVisible( Vector dest )
ENT(pev), &tr );
// check if line of sight to object is not blocked (i.e. visible)
if (tr.flFraction >= 1.0)
if (tr.flFraction >= 1.0f)
return TRUE;
else
return FALSE;
@ -717,7 +717,7 @@ void CBot::BotUnderWater( void )
UTIL_TraceLine( v_src, v_forward, dont_ignore_monsters, ENT(pev), &tr);
// check if the trace didn't hit anything (i.e. nothing in the way)...
if (tr.flFraction >= 1.0)
if (tr.flFraction >= 1.0f)
{
// find out what the contents is of the end of the trace...
contents = UTIL_PointContents( tr.vecEndPos );
@ -736,7 +736,7 @@ void CBot::BotUnderWater( void )
ENT(pev), &tr);
// check if the trace hit something...
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
{
contents = UTIL_PointContents( tr.vecEndPos );
@ -768,7 +768,7 @@ void CBot::BotFindItem( void )
pBotPickupItem = NULL;
min_distance = radius + 1.0;
min_distance = radius + 1.0f;
while ((pEntity = UTIL_FindEntityInSphere( pEntity, pev->origin, radius )) != NULL)
{
@ -806,7 +806,7 @@ void CBot::BotFindItem( void )
UTIL_TraceLine( vecStart, vecEnd, dont_ignore_monsters, ENT(pev), &tr);
// check if traced all the way up to the entity (didn't hit wall)
if (tr.flFraction >= 1.0)
if (tr.flFraction >= 1.0f)
{
// find distance to item for later use...
float distance = (vecEnd - vecStart).Length( );
@ -820,7 +820,7 @@ void CBot::BotFindItem( void )
if (distance < 100)
{
// don't avoid walls for a while
f_dont_avoid_wall_time = gpGlobals->time + 5.0;
f_dont_avoid_wall_time = gpGlobals->time + 5.0f;
}
can_pickup = TRUE;
@ -860,7 +860,7 @@ void CBot::BotFindItem( void )
if (distance < 100)
{
// don't avoid walls for a while
f_dont_avoid_wall_time = gpGlobals->time + 5.0;
f_dont_avoid_wall_time = gpGlobals->time + 5.0f;
}
can_pickup = TRUE;
@ -897,7 +897,7 @@ void CBot::BotFindItem( void )
if (distance < 100)
{
// don't avoid walls for a while
f_dont_avoid_wall_time = gpGlobals->time + 5.0;
f_dont_avoid_wall_time = gpGlobals->time + 5.0f;
}
can_pickup = TRUE;
@ -934,7 +934,7 @@ void CBot::BotFindItem( void )
if (distance < 100)
{
// don't avoid walls for a while
f_dont_avoid_wall_time = gpGlobals->time + 5.0;
f_dont_avoid_wall_time = gpGlobals->time + 5.0f;
}
can_pickup = TRUE;
@ -1183,7 +1183,7 @@ void CBot::BotUseLift( float moved_distance )
}
// check if the bot has waited too long for the lift to move...
if (((f_use_button_time + 2.0) < gpGlobals->time) &&
if (((f_use_button_time + 2.0f) < gpGlobals->time) &&
(!b_lift_moving))
{
// clear use button flag
@ -1233,21 +1233,21 @@ void CBot::BotUseLift( float moved_distance )
UTIL_TraceLine( v_src, v_forward_down, dont_ignore_monsters, ENT(pev), &tr2);
// check if we hit a wall or didn't find a floor...
if ((tr1.flFraction < 1.0) || (tr2.flFraction >= 1.0))
if ((tr1.flFraction < 1.0f) || (tr2.flFraction >= 1.0f))
{
// try tracing to the RIGHT side next...
UTIL_TraceLine( v_src, v_right, dont_ignore_monsters, ENT(pev), &tr1);
UTIL_TraceLine( v_src, v_right_down, dont_ignore_monsters, ENT(pev), &tr2);
// check if we hit a wall or didn't find a floor...
if ((tr1.flFraction < 1.0) || (tr2.flFraction >= 1.0))
if ((tr1.flFraction < 1.0f) || (tr2.flFraction >= 1.0f))
{
// try tracing to the LEFT side next...
UTIL_TraceLine( v_src, v_left, dont_ignore_monsters, ENT(pev), &tr1);
UTIL_TraceLine( v_src, v_left_down, dont_ignore_monsters, ENT(pev), &tr2);
// check if we hit a wall or didn't find a floor...
if ((tr1.flFraction < 1.0) || (tr2.flFraction >= 1.0))
if ((tr1.flFraction < 1.0f) || (tr2.flFraction >= 1.0f))
{
// only thing to do is turn around...
pev->ideal_yaw += 180; // turn all the way around
@ -1379,7 +1379,7 @@ BOOL CBot::BotCantMoveForward( TraceResult *tr )
UTIL_TraceLine( v_src, v_forward, dont_ignore_monsters, ENT(pev), tr);
// check if the trace hit something...
if (tr->flFraction < 1.0)
if (tr->flFraction < 1.0f)
{
return TRUE; // bot's head will hit something
}
@ -1393,7 +1393,7 @@ BOOL CBot::BotCantMoveForward( TraceResult *tr )
UTIL_TraceLine( v_src, v_forward, dont_ignore_monsters, ENT(pev), tr);
// check if the trace hit something...
if (tr->flFraction < 1.0)
if (tr->flFraction < 1.0f)
{
return TRUE; // bot's body will hit something
}
@ -1436,7 +1436,7 @@ BOOL CBot::BotCanJumpUp( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace hit something, return FALSE
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
return FALSE;
// now check same height to one side of the bot...
@ -1447,7 +1447,7 @@ BOOL CBot::BotCanJumpUp( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace hit something, return FALSE
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
return FALSE;
// now check same height on the other side of the bot...
@ -1458,7 +1458,7 @@ BOOL CBot::BotCanJumpUp( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace hit something, return FALSE
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
return FALSE;
// now trace from head level downward to check for obstructions...
@ -1477,7 +1477,7 @@ BOOL CBot::BotCanJumpUp( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace hit something, return FALSE
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
return FALSE;
// now check same height to one side of the bot...
@ -1489,7 +1489,7 @@ BOOL CBot::BotCanJumpUp( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace hit something, return FALSE
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
return FALSE;
// now check same height on the other side of the bot...
@ -1501,7 +1501,7 @@ BOOL CBot::BotCanJumpUp( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace hit something, return FALSE
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
return FALSE;
return TRUE;
@ -1539,7 +1539,7 @@ BOOL CBot::BotCanDuckUnder( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace hit something, return FALSE
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
return FALSE;
// now check same height to one side of the bot...
@ -1550,7 +1550,7 @@ BOOL CBot::BotCanDuckUnder( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace hit something, return FALSE
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
return FALSE;
// now check same height on the other side of the bot...
@ -1561,7 +1561,7 @@ BOOL CBot::BotCanDuckUnder( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace hit something, return FALSE
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
return FALSE;
// now trace from the ground up to check for object to duck under...
@ -1577,7 +1577,7 @@ BOOL CBot::BotCanDuckUnder( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace didn't hit something, return FALSE
if (tr.flFraction >= 1.0)
if (tr.flFraction >= 1.0f)
return FALSE;
// now check same height to one side of the bot...
@ -1589,7 +1589,7 @@ BOOL CBot::BotCanDuckUnder( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace didn't hit something, return FALSE
if (tr.flFraction >= 1.0)
if (tr.flFraction >= 1.0f)
return FALSE;
// now check same height on the other side of the bot...
@ -1601,7 +1601,7 @@ BOOL CBot::BotCanDuckUnder( void )
UTIL_TraceLine( v_source, v_dest, dont_ignore_monsters, ENT(pev), &tr);
// if trace didn't hit something, return FALSE
if (tr.flFraction >= 1.0)
if (tr.flFraction >= 1.0f)
return FALSE;
return TRUE;
@ -1716,7 +1716,7 @@ BOOL CBot::BotCheckWallOnLeft( void )
UTIL_TraceLine( v_src, v_left, dont_ignore_monsters, ENT(pev), &tr);
// check if the trace hit something...
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
{
if (f_wall_on_left == 0)
f_wall_on_left = gpGlobals->time;
@ -1743,7 +1743,7 @@ BOOL CBot::BotCheckWallOnRight( void )
UTIL_TraceLine( v_src, v_right, dont_ignore_monsters, ENT(pev), &tr);
// check if the trace hit something...
if (tr.flFraction < 1.0)
if (tr.flFraction < 1.0f)
{
if (f_wall_on_right == 0)
f_wall_on_right = gpGlobals->time;
@ -1810,7 +1810,7 @@ void CBot::BotThink( void )
f_max_speed = CVAR_GET_FLOAT("sv_maxspeed");
// set next check time to 2 seconds from now
f_speed_check_time = gpGlobals->time + 2.0;
f_speed_check_time = gpGlobals->time + 2.0f;
}
// see how far bot has moved since the previous position...
@ -1899,7 +1899,7 @@ void CBot::BotThink( void )
b_see_tripmine = FALSE;
// pause for a while to allow tripmine to explode...
f_pause_time = gpGlobals->time + 0.5;
f_pause_time = gpGlobals->time + 0.5f;
}
else // run away!!!
{
@ -1925,7 +1925,7 @@ void CBot::BotThink( void )
// check if should use wall mounted health station...
else if (b_use_health_station)
{
if ((f_use_health_time + 10.0) > gpGlobals->time)
if ((f_use_health_time + 10.0f) > gpGlobals->time)
{
f_move_speed = 0; // don't move while using health station
@ -1939,14 +1939,14 @@ void CBot::BotThink( void )
// don't look for items for a while since the bot
// could be stuck trying to get to an item
f_find_item = gpGlobals->time + 0.5;
f_find_item = gpGlobals->time + 0.5f;
}
}
// check if should use wall mounted HEV station...
else if (b_use_HEV_station)
{
if ((f_use_HEV_time + 10.0) > gpGlobals->time)
if ((f_use_HEV_time + 10.0f) > gpGlobals->time)
{
f_move_speed = 0; // don't move while using HEV station
@ -1960,7 +1960,7 @@ void CBot::BotThink( void )
// don't look for items for a while since the bot
// could be stuck trying to get to an item
f_find_item = gpGlobals->time + 0.5;
f_find_item = gpGlobals->time + 0.5f;
}
}
@ -1987,7 +1987,7 @@ void CBot::BotThink( void )
// 20% of the time randomly turn between 45 and 60 degrees
if ((f_wall_on_left != 0) &&
(f_wall_on_left <= gpGlobals->time - 0.5) &&
(f_wall_on_left <= gpGlobals->time - 0.5f) &&
(RANDOM_LONG(1, 100) <= 20))
{
pev->ideal_yaw += RANDOM_LONG(45, 60);
@ -1999,7 +1999,7 @@ void CBot::BotThink( void )
pev->ideal_yaw += 360;
f_move_speed = 0; // don't move while turning
f_dont_avoid_wall_time = gpGlobals->time + 1.0;
f_dont_avoid_wall_time = gpGlobals->time + 1.0f;
}
f_wall_on_left = 0; // reset wall detect time
@ -2012,7 +2012,7 @@ void CBot::BotThink( void )
// 20% of the time randomly turn between 45 and 60 degrees
if ((f_wall_on_right != 0) &&
(f_wall_on_right <= gpGlobals->time - 0.5) &&
(f_wall_on_right <= gpGlobals->time - 0.5f) &&
(RANDOM_LONG(1, 100) <= 20))
{
pev->ideal_yaw -= RANDOM_LONG(45, 60);
@ -2024,7 +2024,7 @@ void CBot::BotThink( void )
pev->ideal_yaw += 360;
f_move_speed = 0; // don't move while turning
f_dont_avoid_wall_time = gpGlobals->time + 1.0;
f_dont_avoid_wall_time = gpGlobals->time + 1.0f;
}
f_wall_on_right = 0; // reset wall detect time
@ -2075,7 +2075,7 @@ void CBot::BotThink( void )
{
// don't look for items for a while since the bot
// could be stuck trying to get to an item
f_find_item = gpGlobals->time + 0.5;
f_find_item = gpGlobals->time + 0.5f;
}
}
}

View File

@ -258,7 +258,7 @@ Vector CBot::BotBodyTarget( CBaseEntity *pBotEnemy )
if (f_distance > 1000)
f_scale = 1.0;
else if (f_distance > 100)
f_scale = f_distance / 1000.0;
f_scale = f_distance / 1000.0f;
else
f_scale = 0.1;
@ -399,7 +399,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
{
// check weapon and ammo inventory then update check time...
BotWeaponInventory();
f_weapon_inventory_time = gpGlobals->time + 1.0;
f_weapon_inventory_time = gpGlobals->time + 1.0f;
}
Vector v_enemy = v_enemy_origin - GetGunPosition( );
@ -428,7 +428,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (whack! whack!)
// set next time to "shoot"
f_shoot_time = gpGlobals->time + 0.3 +
f_shoot_time = gpGlobals->time + 0.3f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_CROWBAR][bot_skill][0],
primary_fire_delay[WEAPON_CROWBAR][bot_skill][1]);
return TRUE;
@ -455,7 +455,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (boom!)
// set next time to "shoot"
f_shoot_time = gpGlobals->time + 0.1 +
f_shoot_time = gpGlobals->time + 0.1f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_HANDGRENADE][bot_skill][0],
primary_fire_delay[WEAPON_HANDGRENADE][bot_skill][1]);
return TRUE;
@ -484,7 +484,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (eek! eek!)
// set next time to "shoot"
f_shoot_time = gpGlobals->time + 0.1 +
f_shoot_time = gpGlobals->time + 0.1f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_SNARK][bot_skill][0],
primary_fire_delay[WEAPON_SNARK][bot_skill][1]);
return TRUE;
@ -544,7 +544,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
f_fire_gauss = -1; // -1 means not charging gauss gun
// set next time to shoot
f_shoot_time = gpGlobals->time + 1.0 +
f_shoot_time = gpGlobals->time + 1.0f +
RANDOM_FLOAT(secondary_fire_delay[WEAPON_GAUSS][bot_skill][0],
secondary_fire_delay[WEAPON_GAUSS][bot_skill][1]);
}
@ -558,7 +558,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
(primary_ammo[WEAPON_GAUSS] >= 10))
{
// release secondary fire in 0.5 seconds...
f_fire_gauss = gpGlobals->time + 0.5;
f_fire_gauss = gpGlobals->time + 0.5f;
pev->button |= IN_ATTACK2; // charge the gauss gun
f_shoot_time = gpGlobals->time; // keep charging
@ -568,7 +568,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.2 +
f_shoot_time = gpGlobals->time + 0.2f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_GAUSS][bot_skill][0],
primary_fire_delay[WEAPON_GAUSS][bot_skill][1]);
}
@ -603,7 +603,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK2; // use secondary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 1.5 +
f_shoot_time = gpGlobals->time + 1.5f +
RANDOM_FLOAT(secondary_fire_delay[WEAPON_SHOTGUN][bot_skill][0],
secondary_fire_delay[WEAPON_SHOTGUN][bot_skill][1]);
}
@ -613,7 +613,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.75 +
f_shoot_time = gpGlobals->time + 0.75f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_SHOTGUN][bot_skill][0],
primary_fire_delay[WEAPON_SHOTGUN][bot_skill][1]);
}
@ -642,7 +642,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.75 +
f_shoot_time = gpGlobals->time + 0.75f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_PYTHON][bot_skill][0],
primary_fire_delay[WEAPON_PYTHON][bot_skill][1]);
@ -677,7 +677,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK2; // use secondary attack (buzz! buzz!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.1 +
f_shoot_time = gpGlobals->time + 0.1f +
RANDOM_FLOAT(secondary_fire_delay[WEAPON_HORNETGUN][bot_skill][0],
secondary_fire_delay[WEAPON_HORNETGUN][bot_skill][1]);
// BigGuy - END
@ -687,7 +687,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (buzz! buzz!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.25 +
f_shoot_time = gpGlobals->time + 0.25f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_HORNETGUN][bot_skill][0],
primary_fire_delay[WEAPON_HORNETGUN][bot_skill][1]);
}
@ -724,7 +724,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK2; // use secodnary attack (boom!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 1.0 +
f_shoot_time = gpGlobals->time + 1.0f +
RANDOM_FLOAT(secondary_fire_delay[WEAPON_MP5][bot_skill][0],
secondary_fire_delay[WEAPON_MP5][bot_skill][1]);
@ -749,7 +749,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.1 +
f_shoot_time = gpGlobals->time + 0.1f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_MP5][bot_skill][0],
primary_fire_delay[WEAPON_MP5][bot_skill][1]);
@ -785,7 +785,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK2; // use secodnary attack (boom!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 1.0 +
f_shoot_time = gpGlobals->time + 1.0f +
RANDOM_FLOAT(secondary_fire_delay[WEAPON_MP41A][bot_skill][0],
secondary_fire_delay[WEAPON_MP41A][bot_skill][1]);
@ -810,7 +810,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.1 +
f_shoot_time = gpGlobals->time + 0.1f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_MP41A][bot_skill][0],
primary_fire_delay[WEAPON_MP41A][bot_skill][1]);
@ -845,7 +845,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK2; // use secodnary attack (boom!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 1.0 +
f_shoot_time = gpGlobals->time + 1.0f +
RANDOM_FLOAT(secondary_fire_delay[WEAPON_MINIGUN][bot_skill][0],
secondary_fire_delay[WEAPON_MINIGUN][bot_skill][1]);
@ -870,7 +870,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.1 +
f_shoot_time = gpGlobals->time + 0.1f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_MINIGUN][bot_skill][0],
primary_fire_delay[WEAPON_MINIGUN][bot_skill][1]);
@ -898,7 +898,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.75 +
f_shoot_time = gpGlobals->time + 0.75f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_CROSSBOW][bot_skill][0],
primary_fire_delay[WEAPON_CROSSBOW][bot_skill][1]);
@ -926,7 +926,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 1.5 +
f_shoot_time = gpGlobals->time + 1.5f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_RPG][bot_skill][0],
primary_fire_delay[WEAPON_RPG][bot_skill][1]);
@ -960,7 +960,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK2; // use secondary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.2 +
f_shoot_time = gpGlobals->time + 0.2f +
RANDOM_FLOAT(secondary_fire_delay[WEAPON_GLOCK][bot_skill][0],
secondary_fire_delay[WEAPON_GLOCK][bot_skill][1]);
// BigGuy - END
@ -970,7 +970,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.3 +
f_shoot_time = gpGlobals->time + 0.3f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_GLOCK][bot_skill][0],
primary_fire_delay[WEAPON_GLOCK][bot_skill][1]);
}
@ -1005,7 +1005,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK2; // use secondary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.2 +
f_shoot_time = gpGlobals->time + 0.2f +
RANDOM_FLOAT(secondary_fire_delay[WEAPON_EAGEL][bot_skill][0],
secondary_fire_delay[WEAPON_EAGEL][bot_skill][1]);
// BigGuy - END
@ -1015,7 +1015,7 @@ BOOL CBot::BotFireWeapon( Vector v_enemy_origin, int weapon_choice, BOOL primary
pev->button |= IN_ATTACK; // use primary attack (bang! bang!)
// set next time to shoot
f_shoot_time = gpGlobals->time + 0.3 +
f_shoot_time = gpGlobals->time + 0.3f +
RANDOM_FLOAT(primary_fire_delay[WEAPON_EAGEL][bot_skill][0],
primary_fire_delay[WEAPON_EAGEL][bot_skill][1]);
}

View File

@ -74,7 +74,7 @@ void CBotCam::Spawn( void )
SetThink( &CBotCam::IdleThink );
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}

View File

@ -131,7 +131,7 @@ void CEagel::SecondaryAttack( void )
m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 40;
}
m_flNextSecondaryAttack = 0.5;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f;
}
void CEagel::Holster( int skiplocal /* = 0 */ )
@ -143,7 +143,7 @@ void CEagel::Holster( int skiplocal /* = 0 */ )
SecondaryAttack();
}
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f;
m_flTimeWeaponIdle = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
SendWeaponAnim( EAGEL_HOLSTER );
}
@ -160,7 +160,7 @@ void CEagel::EagelFire( float flSpread, float flCycleTime, BOOL fUseAutoAim )
if (m_fFireOnEmpty)
{
PlayEmptySound();
m_flNextPrimaryAttack = GetNextAttackDelay( 0.2 );
m_flNextPrimaryAttack = GetNextAttackDelay( 0.2f );
}
return;
@ -261,20 +261,20 @@ void CEagel::WeaponIdle( void )
int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0, 1.0 );
if (flRand <= 0.3 + 0 * 0.75)
if (flRand <= 0.3f)
{
iAnim = EAGEL_IDLE3;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 49.0 / 16;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 49.0f / 16.0f;
}
else if (flRand <= 0.6 + 0 * 0.875)
else if (flRand <= 0.6f)
{
iAnim = EAGEL_IDLE1;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0 / 16.0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f / 16.0f;
}
else
{
iAnim = EAGEL_IDLE2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0f / 16.0f;
}
SendWeaponAnim( iAnim, 1 );
}

View File

@ -325,7 +325,7 @@ void CKate :: SetYawSpeed ( void )
//=========================================================
BOOL CKate :: CheckRangeAttack1 ( float flDot, float flDist )
{
if ( flDist <= 1024 && flDot >= 0.5 )
if ( flDist <= 1024 && flDot >= 0.5f )
{
if ( gpGlobals->time > m_checkAttackTime )
{
@ -336,11 +336,11 @@ BOOL CKate :: CheckRangeAttack1 ( float flDot, float flDist )
Vector shootTarget = ( (pEnemy->BodyTarget( shootOrigin ) - pEnemy->pev->origin) + m_vecEnemyLKP );
UTIL_TraceLine( shootOrigin, shootTarget, dont_ignore_monsters, ENT(pev), &tr );
m_checkAttackTime = gpGlobals->time + 1;
if ( tr.flFraction == 1.0 || (tr.pHit != NULL && CBaseEntity::Instance(tr.pHit) == pEnemy) )
if ( tr.flFraction == 1.0f || (tr.pHit != NULL && CBaseEntity::Instance(tr.pHit) == pEnemy) )
m_lastAttackCheck = TRUE;
else
m_lastAttackCheck = FALSE;
m_checkAttackTime = gpGlobals->time + 1.5;
m_checkAttackTime = gpGlobals->time + 1.5f;
}
return m_lastAttackCheck;
}
@ -540,7 +540,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;
}

View File

@ -438,7 +438,7 @@ BOOL CHGrunt_bo :: CheckMeleeAttack1 ( float flDot, float flDist )
}
}
if ( flDist <= 64 && flDot >= 0.7 &&
if ( flDist <= 64 && flDot >= 0.7f &&
pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON &&
pEnemy->Classify() != CLASS_PLAYER_BIOWEAPON )
{
@ -457,7 +457,7 @@ BOOL CHGrunt_bo :: CheckMeleeAttack1 ( float flDot, float flDist )
//=========================================================
BOOL CHGrunt_bo :: CheckRangeAttack1 ( float flDot, float flDist )
{
if ( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5 && NoFriendlyFire() )
if ( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5f && NoFriendlyFire() )
{
TraceResult tr;
@ -472,7 +472,7 @@ BOOL CHGrunt_bo :: CheckRangeAttack1 ( float flDot, float flDist )
// verify that a bullet fired from the gun will hit the enemy before the world.
UTIL_TraceLine( vecSrc, m_hEnemy->BodyTarget(vecSrc), ignore_monsters, ignore_glass, ENT(pev), &tr);
if ( tr.flFraction == 1.0 )
if ( tr.flFraction == 1.0f )
{
return TRUE;
}
@ -595,7 +595,7 @@ BOOL CHGrunt_bo :: CheckRangeAttack2 ( float flDot, float flDist )
// throw a hand grenade
m_fThrowGrenade = TRUE;
// don't check again for a while.
m_flNextGrenadeCheck = gpGlobals->time + 0.3; // 1/3 second.
m_flNextGrenadeCheck = gpGlobals->time + 0.3f; // 1/3 second.
}
else
{
@ -765,7 +765,7 @@ CBaseEntity *CHGrunt_bo :: Kick( void )
UTIL_MakeVectors( pev->angles );
Vector vecStart = pev->origin;
vecStart.z += pev->size.z * 0.5;
vecStart.z += pev->size.z * 0.5f;
Vector vecEnd = vecStart + (gpGlobals->v_forward * 70);
UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT(pev), &tr );
@ -2497,7 +2497,7 @@ void CHGruntRepel_bo::RepelUse ( CBaseEntity *pActivator, CBaseEntity *pCaller,
pBeam->SetFlags( BEAM_FSOLID );
pBeam->SetColor( 255, 255, 255 );
pBeam->SetThink(&CBeam:: SUB_Remove );
pBeam->SetNextThink( -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5 );
pBeam->SetNextThink( -4096.0f * tr.flFraction / pGrunt->pev->velocity.z + 0.5f );
UTIL_Remove( this );
}

View File

@ -116,15 +116,15 @@ void CMinigun::PrimaryAttack()
// don't fire underwater
if (m_pPlayer->pev->waterlevel == 3 && m_pPlayer->pev->watertype > CONTENT_FLYFIELD)
{
PlayEmptySound( );
m_flNextPrimaryAttack = 0.15;
PlayEmptySound();
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return;
}
if (m_iClip <= 0)
{
PlayEmptySound();
m_flNextPrimaryAttack = 0.15;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return;
}
@ -172,10 +172,10 @@ void CMinigun::PrimaryAttack()
// HEV suit - indicate out of ammo condition
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
m_flNextPrimaryAttack = GetNextAttackDelay( 0.05 );
m_flNextPrimaryAttack = GetNextAttackDelay( 0.05f );
if ( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() )
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.05;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.05f;
#ifndef CLIENT_DLL
UTIL_ScreenShake( pev->origin, 5.0, 150.0, 0.75, 250.0 );
@ -190,15 +190,15 @@ void CMinigun::SecondaryAttack( void )
// don't fire underwater
if (m_pPlayer->pev->waterlevel == 3 && m_pPlayer->pev->watertype > CONTENT_FLYFIELD)
{
PlayEmptySound( );
m_flNextSecondaryAttack = 0.15;
PlayEmptySound();
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return;
}
if (m_iClip <= 0)
{
PlayEmptySound();
m_flNextSecondaryAttack = 0.15;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return;
}
@ -246,10 +246,10 @@ void CMinigun::SecondaryAttack( void )
// HEV suit - indicate out of ammo condition
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
m_flNextSecondaryAttack = GetNextAttackDelay( 0.01 );
m_flNextSecondaryAttack = GetNextAttackDelay( 0.01f );
if ( m_flNextSecondaryAttack < UTIL_WeaponTimeBase() )
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.01;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.01f;
#ifndef CLIENT_DLL
UTIL_ScreenShake( pev->origin, 5.0, 150.0, 0.75, 250.0 );

View File

@ -132,14 +132,14 @@ void CMP41a::PrimaryAttack()
if (m_pPlayer->pev->waterlevel == 3 && m_pPlayer->pev->watertype > CONTENT_FLYFIELD)
{
PlayEmptySound( );
m_flNextPrimaryAttack = 0.15;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return;
}
if (m_iClip <= 0)
{
PlayEmptySound();
m_flNextPrimaryAttack = 0.15;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return;
}
@ -186,10 +186,10 @@ void CMP41a::PrimaryAttack()
// HEV suit - indicate out of ammo condition
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
m_flNextPrimaryAttack = GetNextAttackDelay( 0.1 );
m_flNextPrimaryAttack = GetNextAttackDelay( 0.1f );
if ( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() )
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}
@ -202,7 +202,7 @@ void CMP41a::SecondaryAttack( void )
if (m_pPlayer->pev->waterlevel == 3 && m_pPlayer->pev->watertype > CONTENT_FLYFIELD)
{
PlayEmptySound( );
m_flNextPrimaryAttack = 0.15;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f;
return;
}
@ -216,7 +216,7 @@ void CMP41a::SecondaryAttack( void )
m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH;
m_pPlayer->m_iExtraSoundTypes = bits_SOUND_DANGER;
m_pPlayer->m_flStopExtraSoundTime = UTIL_WeaponTimeBase() + 0.2;
m_pPlayer->m_flStopExtraSoundTime = UTIL_WeaponTimeBase() + 0.2f;
m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType]--;

View File

@ -541,7 +541,7 @@ void CScientist_suit :: RunTask( Task_t *pTask )
distance = ( m_vecMoveGoal - pev->origin ).Length2D();
// Re-evaluate when you think your finished, or the target has moved too far
if ( (distance < pTask->flData) || (m_vecMoveGoal - m_hTargetEnt->pev->origin).Length() > pTask->flData * 0.5 )
if ( (distance < pTask->flData) || (m_vecMoveGoal - m_hTargetEnt->pev->origin).Length() > pTask->flData * 0.5f )
{
m_vecMoveGoal = m_hTargetEnt->pev->origin;
distance = ( m_vecMoveGoal - pev->origin ).Length2D();
@ -1095,7 +1095,7 @@ MONSTERSTATE CScientist_suit :: GetIdealState ( void )
BOOL CScientist_suit::CanHeal( void )
{
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;

View File

@ -66,7 +66,7 @@ void CShock::Spawn( )
m_vecForward = gpGlobals->v_forward;
pev->gravity = 0.5;
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}

View File

@ -51,7 +51,7 @@ void CShockball::Spawn( )
SetThink( &CShockball::FlyThink );
SetTouch( &CShockball::ShockballTouch );
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
ResetSequenceInfo( );
}
@ -72,7 +72,7 @@ void CShockball::FlyThink( void )
{
StudioFrameAdvance( );
BlastOn();
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}
void CShockball::ShockballTouch( CBaseEntity *pOther )
@ -190,7 +190,7 @@ void CShockball::BlastOn ( void )
pBeam->SetScrollRate( 35 );
pBeam->LiveForTime( 1 );
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
if(!m_pSprite)

View File

@ -36,7 +36,7 @@ void CShockRifle::Spawn( )
m_iId = WEAPON_SHOCKRIFLE;
SET_MODEL(ENT(pev), "models/w_shock_rifle.mdl");
pev->sequence = 0;
pev->animtime = gpGlobals->time + 0.1;
pev->animtime = gpGlobals->time + 0.1f;
pev->framerate = 1.0;
m_iDefaultAmmo = SHOCK_DEFAULT_GIVE;
@ -112,7 +112,7 @@ BOOL CShockRifle::Deploy( )
void CShockRifle::Holster( int skiplocal /* = 0 */ )
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
SendWeaponAnim( SHOCK_HOLSTER );
//!!!HACKHACK - can't select hornetgun if it's empty! no way to get ammo for it, either.
@ -171,7 +171,7 @@ void CShockRifle::PrimaryAttack()
CBaseEntity *pShock = CBaseEntity::Create( "shock", vecSrc, anglesAim, m_pPlayer->edict() );
pShock->pev->velocity = gpGlobals->v_forward * 1500;
m_flRechargeTime = gpGlobals->time + 0.5;
m_flRechargeTime = gpGlobals->time + 0.5f;
#endif
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;
@ -181,14 +181,14 @@ void CShockRifle::PrimaryAttack()
m_pPlayer->m_iWeaponFlash = DIM_GUN_FLASH;
m_flNextPrimaryAttack = m_flNextPrimaryAttack + 0.25;
m_flNextPrimaryAttack = m_flNextPrimaryAttack + 0.25f;
if (m_flNextPrimaryAttack < UTIL_WeaponTimeBase() )
{
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f;
}
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f;
}
@ -201,7 +201,7 @@ void CShockRifle::Reload( void )
{
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_WEAPON, "weapons/shock_recharge.wav", 1.0, ATTN_NORM, 0, 100);
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]++;
m_flRechargeTime += 0.7;
m_flRechargeTime += 0.7f;
}
}
@ -216,7 +216,7 @@ void CShockRifle::WeaponIdle( void )
int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
if (flRand <= 0.75)
if (flRand <= 0.75f)
{
iAnim = SHOCK_IDLE1;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5;

View File

@ -112,7 +112,7 @@ BOOL CSwort::Deploy( )
void CSwort::Holster( int skiplocal /* = 0 */ )
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
SendWeaponAnim( SWORT_HOLSTER );
}
@ -130,7 +130,7 @@ extern void FindHullIntersection( const Vector &vecSrc, TraceResult &tr1, float
vecHull2End = vecSrc + ((vecHull2End - vecSrc)*2);
UTIL_TraceLine( vecSrc, vecHull2End, dont_ignore_monsters, pEntity, &tmpTrace );
if ( tmpTrace.flFraction < 1.0 )
if ( tmpTrace.flFraction < 1.0f )
{
tr1 = tmpTrace;
return;
@ -147,7 +147,7 @@ extern void FindHullIntersection( const Vector &vecSrc, TraceResult &tr1, float
vecEnd.z = vecHull2End.z + minmaxs[k][2];
UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, pEntity, &tmpTrace );
if ( tmpTrace.flFraction < 1.0 )
if ( tmpTrace.flFraction < 1.0f )
{
float thisDistance = (tmpTrace.vecEndPos - vecSrc).Length();
if ( thisDistance < distance )
@ -197,10 +197,10 @@ int CSwort::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
@ -219,12 +219,12 @@ int CSwort::Swing( int fFirst )
0.0, 0, 0.0 );
}
if ( tr.flFraction >= 1.0 )
if ( tr.flFraction >= 1.0f )
{
if (fFirst)
{
// miss
m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 );
m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f );
#ifdef CROWBAR_IDLE_ANIM
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
#endif
@ -294,7 +294,7 @@ int CSwort::Swing( int fFirst )
m_pPlayer->m_iWeaponVolume = SWORT_BODYHIT_VOLUME;
if ( !pEntity->IsAlive() )
{
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; //LRC: corrected half-life bug
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; //LRC: corrected half-life bug
return TRUE;
}
else
@ -336,10 +336,10 @@ int CSwort::Swing( int fFirst )
m_pPlayer->m_iWeaponVolume = flVol * SWORT_WALLHIT_VOLUME;
#endif
m_flNextPrimaryAttack = GetNextAttackDelay( 0.25 );
m_flNextPrimaryAttack = GetNextAttackDelay( 0.25f );
SetThink(&CSwort:: Smack );
SetNextThink( 0.2 );
SetNextThink( 0.2f );
}
@ -356,22 +356,22 @@ void CSwort::WeaponIdle( void )
{
int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
if( flRand > 0.9 )
if( flRand > 0.9f )
{
iAnim = CROWBAR_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 = CROWBAR_IDLE;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 30.0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f;
}
else
{
iAnim = CROWBAR_IDLE3;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f;
}
}
SendWeaponAnim( iAnim );

View File

@ -416,7 +416,7 @@ BOOL CHTorch :: CheckMeleeAttack1 ( float flDot, float flDist )
}
}
if ( flDist <= 64 && flDot >= 0.7 &&
if ( flDist <= 64 && flDot >= 0.7f &&
pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON &&
pEnemy->Classify() != CLASS_PLAYER_BIOWEAPON )
{
@ -435,7 +435,7 @@ BOOL CHTorch :: CheckMeleeAttack1 ( float flDot, float flDist )
//=========================================================
BOOL CHTorch :: CheckRangeAttack1 ( float flDot, float flDist )
{
if ( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5 && NoFriendlyFire() )
if ( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5f && NoFriendlyFire() )
{
TraceResult tr;
@ -450,7 +450,7 @@ BOOL CHTorch :: CheckRangeAttack1 ( float flDot, float flDist )
// verify that a bullet fired from the gun will hit the enemy before the world.
UTIL_TraceLine( vecSrc, m_hEnemy->BodyTarget(vecSrc), ignore_monsters, ignore_glass, ENT(pev), &tr);
if ( tr.flFraction == 1.0 )
if ( tr.flFraction == 1.0f )
{
return TRUE;
}
@ -495,7 +495,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;
}
@ -660,7 +660,7 @@ CBaseEntity *CHTorch :: Kick( void )
UTIL_MakeVectors( pev->angles );
Vector vecStart = pev->origin;
vecStart.z += pev->size.z * 0.5;
vecStart.z += pev->size.z * 0.5f;
Vector vecEnd = vecStart + (gpGlobals->v_forward * 70);
UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT(pev), &tr );
@ -737,7 +737,7 @@ void CHTorch::UpdateGas( void )
Vector vecEnd = (gpGlobals->v_forward * 5) + posGun;
UTIL_TraceLine( posGun, vecEnd, dont_ignore_monsters, edict(), &tr );
if ( tr.flFraction != 1.0 )
if ( tr.flFraction != 1.0f )
{
m_pBeam->DoSparks( tr.vecEndPos, posGun );
UTIL_DecalTrace(&tr, DECAL_BIGSHOT1 + RANDOM_LONG(0,4));
@ -788,9 +788,8 @@ void CHTorch::UpdateGas( void )
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}
}
void CHTorch::MakeGas( void )
@ -2363,7 +2362,7 @@ void CHTorchRepel::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 / pTorch->pev->velocity.z + 0.5;
pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pTorch->pev->velocity.z + 0.5f;
UTIL_Remove( this );
}

View File

@ -174,10 +174,10 @@ void CUZI::PrimaryAttack()
// HEV suit - indicate out of ammo condition
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
m_flNextPrimaryAttack = GetNextAttackDelay( 0.1 );
m_flNextPrimaryAttack = GetNextAttackDelay( 0.1f );
if ( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() )
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.01;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.01f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}