Double promotion fixes.

This commit is contained in:
Andrey Akhmichin 2020-01-04 06:48:08 +05:00
parent 15039572a1
commit 52168fc09c
22 changed files with 137 additions and 136 deletions

View File

@ -107,7 +107,7 @@ int CHudBonus ::Draw(float flTime )
//Just activated
if ( g_PlayerBonus[ index ].bActive && !g_PlayerBonus[ index ].flBonusTime )
{
g_PlayerBonus[ index ].flBonusTime = flTime + 5.0;
g_PlayerBonus[ index ].flBonusTime = flTime + 5.0f;
for ( int i = 1; i < MAX_BONUS + 1; i++ )
{

View File

@ -465,8 +465,8 @@ void Dmc_TouchTeleporters ( struct local_state_s *player, dmc_tele_t *pTeles, i
{
for( j = 0; j < 3; j++ )
{
pTele->absmin[ j ] = g_vecTeleMins[ iTeleNum ][ j ] - 1.0;
pTele->absmax[ j ] = g_vecTeleMaxs[ iTeleNum ][ j ] + 1.0;
pTele->absmin[ j ] = g_vecTeleMins[ iTeleNum ][ j ] - 1.0f;
pTele->absmax[ j ] = g_vecTeleMaxs[ iTeleNum ][ j ] + 1.0f;
}
iTeleNum++;

View File

@ -460,7 +460,7 @@ void EV_Quake_FireBullets( int idx, float *forward, float *right, float *up, int
for( i = 0; i < 3; i++ )
{
vecDir[i] = vecDirShooting[i] + spread[0] * vecSpread[0] * vecRight[i] + spread[1] * vecSpread[1] * up [i];
vecEnd[i] = vecSrc[i] + 2048.0 * vecDir[i];
vecEnd[i] = vecSrc[i] + 2048.0f * vecDir[i];
}
gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction( false, true );
@ -640,7 +640,7 @@ void EV_FireAxe( event_args_t *args )
gEngfuncs.pEventAPI->EV_SetTraceHull( 2 );
gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_NORMAL, -1, &tr );
if( tr.fraction < 1.0 )
if( tr.fraction < 1.0f )
{
ent = gEngfuncs.pEventAPI->EV_IndexFromTrace( &tr );
@ -733,7 +733,7 @@ void EV_TrailCallback( struct tempent_s *ent, float frametime, float currenttime
VectorCopy( player->origin, dl->origin );
dl->radius = 240;
dl->die = gEngfuncs.GetClientTime() + 0.001; // Kill it right away
dl->die = gEngfuncs.GetClientTime() + 0.001f; // Kill it right away
if( ent->entity.baseline.movetype == 2 )
{
@ -774,11 +774,11 @@ void EV_TrailCallback( struct tempent_s *ent, float frametime, float currenttime
bPart->color = 43;
bPart->type = pt_slowgrav;
bPart->die = gEngfuncs.GetClientTime() + 0.5;
bPart->die = gEngfuncs.GetClientTime() + 0.5f;
}
}
ent->entity.baseline.animtime = gEngfuncs.GetClientTime() + 0.3;
ent->entity.baseline.animtime = gEngfuncs.GetClientTime() + 0.3f;
}
@ -819,7 +819,7 @@ void EV_FollowCarrier( event_args_t *args )
pTrailSpawner->clientIndex = iEntIndex;
pTrailSpawner->entity.baseline.movetype = iTeam; // Hack to store the team number on this temp ent.
pTrailSpawner->entity.baseline.animtime = gEngfuncs.GetClientTime() + 0.3;
pTrailSpawner->entity.baseline.animtime = gEngfuncs.GetClientTime() + 0.3f;
pTrailSpawner->callback = EV_TrailCallback;
}
}
@ -875,7 +875,7 @@ void EV_PowerupCallback( struct tempent_s *ent, float frametime, float currentti
dl->radius = 270;
dl->dark = true;
dl->die = gEngfuncs.GetClientTime() + 0.001; //Kill it right away
dl->die = gEngfuncs.GetClientTime() + 0.001f; //Kill it right away
if( ent->entity.baseline.iuser2 == 1 )
{
@ -988,7 +988,7 @@ void EV_FireLightning( event_args_t *args )
if ( g_flLightTime <= gEngfuncs.GetClientTime() )
{
gEngfuncs.pfnWeaponAnim( 1, 0 );
g_flLightTime = gEngfuncs.GetClientTime() + 0.5;
g_flLightTime = gEngfuncs.GetClientTime() + 0.5f;
}
V_PunchAxis( 0, Q_SMALL_PUNCHANGLE_KICK );
@ -1017,7 +1017,7 @@ void EV_FireLightning( event_args_t *args )
if( pl )
{
VectorCopy( gHUD.m_vecAngles, angles );
AngleVectors( angles, forward, right, up );
EV_GetGunPosition( args, vecSrc, pl->origin );
@ -1111,7 +1111,7 @@ void EV_FireSpike( event_args_t *args )
vec3_t angles;
vec3_t up, right, forward;
vec3_t vecVelocity;
float offset = args->bparam1 ? 2.0 : -2.0;
float offset = args->bparam1 ? 2.0f : -2.0f;
int shell;
@ -1189,9 +1189,9 @@ void EV_TrainPitchAdjust( event_args_t *args )
us_params = (unsigned short)args->iparam1;
stop = args->bparam1;
m_flVolume = (float)(us_params & 0x003f)/40.0;
m_flVolume = (float)(us_params & 0x003f)/40.0f;
noise = (int)(((us_params) >> 12 ) & 0x0007);
pitch = (int)( 10.0 * (float)( ( us_params >> 6 ) & 0x003f ) );
pitch = (int)( 10.0f * (float)( ( us_params >> 6 ) & 0x003f ) );
switch( noise )
{
@ -1415,7 +1415,7 @@ void EV_RocketTrailCallback( struct tempent_s *ent, float frametime, float curre
dl->radius = 160;
dl->dark = true;
dl->die = gEngfuncs.GetClientTime() + 0.001; //Kill it right away
dl->die = gEngfuncs.GetClientTime() + 0.001f; //Kill it right away
dl->color.r = 255;
dl->color.g = 255;
@ -1445,7 +1445,7 @@ void EV_Trail( event_args_t *args )
pTrailSpawner->entity.baseline.sequence = 70;
pTrailSpawner->die = gEngfuncs.GetClientTime() + 10; // Just in case
pTrailSpawner->entity.baseline.fuser1 = gEngfuncs.GetClientTime() + 0.5; // Don't try to die till 500ms ahead
pTrailSpawner->entity.baseline.fuser1 = gEngfuncs.GetClientTime() + 0.5f; // Don't try to die till 500ms ahead
}
}

View File

@ -64,7 +64,7 @@ void UpdateBeams ( void )
gEngfuncs.pEventAPI->EV_PopPMStates();
pBeam->target = tr.endpos;
pBeam->die = gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit forward in the future, just in case.
pBeam->die = gEngfuncs.GetClientTime() + 0.1f; // We keep it alive just a little bit forward in the future, just in case.
}
/*
@ -78,4 +78,4 @@ void Game_AddObjects( void )
{
if ( pBeam )
UpdateBeams();
}
}

View File

@ -287,7 +287,7 @@ Handles weapon firing, reloading, etc.
*/
void CBasePlayerWeapon::ItemPostFrame( void )
{
if ((m_fInReload) && (m_pPlayer->m_flNextAttack <= 0.0))
if ((m_fInReload) && (m_pPlayer->m_flNextAttack <= 0.0f))
{
#if 0 // FIXME, need ammo on client to make this work right
// complete the reload.
@ -302,7 +302,7 @@ void CBasePlayerWeapon::ItemPostFrame( void )
m_fInReload = FALSE;
}
if ((m_pPlayer->pev->button & IN_ATTACK2) && (m_flNextSecondaryAttack <= 0.0))
if ((m_pPlayer->pev->button & IN_ATTACK2) && (m_flNextSecondaryAttack <= 0.0f))
{
if ( pszAmmo2() && !m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] )
{
@ -312,7 +312,7 @@ void CBasePlayerWeapon::ItemPostFrame( void )
SecondaryAttack();
m_pPlayer->pev->button &= ~IN_ATTACK2;
}
else if ((m_pPlayer->pev->button & IN_ATTACK) && (m_flNextPrimaryAttack <= 0.0))
else if ((m_pPlayer->pev->button & IN_ATTACK) && (m_flNextPrimaryAttack <= 0.0f))
{
if ( (m_iClip == 0 && pszAmmo1()) || (iMaxClip() == -1 && !m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] ) )
{
@ -789,7 +789,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
player.m_iAmmoRockets = from->client.ammo_rockets;
player.m_iAmmoNails = from->client.ammo_nails;
player.m_iNailOffset = (int)from->client.fuser2 != 0.0 ? 4.0 : -4.0;
player.m_iNailOffset = (int)from->client.fuser2 != 0.0f ? 4.0f : -4.0f;
@ -868,7 +868,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
to->client.maxspeed = player.pev->maxspeed;
to->client.iuser3 = player.m_iQuakeItems;
to->client.fuser1 = (float)player.m_iQuakeWeapon;
to->client.fuser2 = (float)player.m_iNailOffset > 0.0 ? 1.0 : 0.0;
to->client.fuser2 = (float)player.m_iNailOffset > 0.0f ? 1.0f : 0.0f;
to->client.ammo_shells = player.m_iAmmoShells;
to->client.ammo_cells = player.m_iAmmoCells;
@ -903,50 +903,50 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
pto->m_flTimeWeaponIdle = pCurrent->m_flTimeWeaponIdle;
// 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->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;
if ( pto->m_flPumpTime != -9999 )
{
pto->m_flPumpTime -= cmd->msec / 1000.0;
if ( pto->m_flPumpTime < -0.001 )
pto->m_flPumpTime = -0.001;
pto->m_flPumpTime -= cmd->msec / 1000.0f;
if ( pto->m_flPumpTime < -0.001f )
pto->m_flPumpTime = -0.001f;
}
if ( pto->m_fNextAimBonus < -1.0 )
if ( pto->m_fNextAimBonus < -1.0f )
{
pto->m_fNextAimBonus = -1.0;
pto->m_fNextAimBonus = -1.0f;
}
if ( pto->m_flNextPrimaryAttack < -1.0 )
if ( pto->m_flNextPrimaryAttack < -1.0f )
{
pto->m_flNextPrimaryAttack = -1.0;
pto->m_flNextPrimaryAttack = -1.0f;
}
if ( pto->m_flNextSecondaryAttack < -0.001 )
if ( pto->m_flNextSecondaryAttack < -0.001f )
{
pto->m_flNextSecondaryAttack = -0.001;
pto->m_flNextSecondaryAttack = -0.001f;
}
if ( pto->m_flTimeWeaponIdle < -0.001 )
if ( pto->m_flTimeWeaponIdle < -0.001f )
{
pto->m_flTimeWeaponIdle = -0.001;
pto->m_flTimeWeaponIdle = -0.001f;
}
if ( pto->m_flNextReload < -0.001 )
if ( pto->m_flNextReload < -0.001f )
{
pto->m_flNextReload = -0.001;
pto->m_flNextReload = -0.001f;
}
}
// m_flNextAttack is now part of the weapons, but is part of the player instead
to->client.m_flNextAttack -= cmd->msec / 1000.0;
if ( to->client.m_flNextAttack < -0.001 )
to->client.m_flNextAttack -= cmd->msec / 1000.0f;
if ( to->client.m_flNextAttack < -0.001f )
{
to->client.m_flNextAttack = -0.001;
to->client.m_flNextAttack = -0.001f;
}
// Store off the last position from the predicted state.

View File

@ -52,7 +52,7 @@ void CItemFlag::Spawn()
SetThink( &CItemFlag::FlagThink );
SetTouch( &CItemFlag::FlagTouch );
pev->nextthink = gpGlobals->time + 0.3;
pev->nextthink = gpGlobals->time + 0.3f;
//Set the Skin based on the team.
pev->skin = pev->team;
@ -273,7 +273,7 @@ void CItemFlag::FlagTouch( CBaseEntity *pToucher )
0.0, 0.0, pPlayer->entindex(), pPlayer->pev->team, 0, 0 );
}
( (CThreeWave*)g_pGameRules )->m_flFlagStatusTime = gpGlobals->time + 0.1;
( (CThreeWave*)g_pGameRules )->m_flFlagStatusTime = gpGlobals->time + 0.1f;
}
}
@ -422,7 +422,7 @@ void CItemFlag::ResetFlag( int iTeam )
}
}
( (CThreeWave*)g_pGameRules )->m_flFlagStatusTime = gpGlobals->time + 0.1;
( (CThreeWave*)g_pGameRules )->m_flFlagStatusTime = gpGlobals->time + 0.1f;
}
void CItemFlag::FlagThink()
@ -446,7 +446,7 @@ void CItemFlag::FlagThink()
}
//Using 0.2 just in case we might lag the server.
pev->nextthink = gpGlobals->time + 0.2;
pev->nextthink = gpGlobals->time + 0.2f;
}
void CItemFlag::Precache()
@ -505,7 +505,7 @@ void CCarriedFlag::Spawn()
m_iOwnerOldVel = 0;
SetThink( &CCarriedFlag::FlagThink );
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}
void CCarriedFlag::Precache()
@ -540,11 +540,11 @@ void CCarriedFlag::FlagThink()
pev->frame += pev->framerate;
if( pev->frame < 0.0 || pev->frame >= 256.0 )
if( pev->frame < 0.0f || pev->frame >= 256.0f )
{
pev->frame -= (int)( pev->frame / 256.0 ) * 256.0;
pev->frame -= (int)( pev->frame / 256.0f ) * 256.0f;
}
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}
}

View File

@ -134,7 +134,7 @@ void CGrapple::GrappleTouch( CBaseEntity *pOther )
pev->enemy = pOther->edict();// remember this guy!
SetThink( &CGrapple::Grapple_Track );
pev->nextthink = gpGlobals->time;
m_flNextIdleTime = gpGlobals->time + 0.1;
m_flNextIdleTime = gpGlobals->time + 0.1f;
pev->solid = SOLID_NOT;
SetTouch( NULL );
}
@ -216,7 +216,7 @@ void CGrapple::Grapple_Track()
else
pev->velocity = pEnemy->pev->velocity;
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}
void CBasePlayer::Service_Grapple()
@ -291,13 +291,13 @@ void CGrapple::OnAirThink()
UTIL_TraceLine( pev->origin, pOwner->pev->origin, ignore_monsters, ENT( pev ), &tr );
if( tr.flFraction < 1.0 )
if( tr.flFraction < 1.0f )
{
Reset_Grapple();
return;
}
pev->nextthink = gpGlobals->time + 0.5;
pev->nextthink = gpGlobals->time + 0.5f;
}
void CGrapple::Spawn()
@ -310,7 +310,7 @@ void CGrapple::Spawn()
SetTouch( &CGrapple::GrappleTouch );
SetThink( &CGrapple::OnAirThink );
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}
LINK_ENTITY_TO_CLASS( hook, CGrapple );

View File

@ -404,7 +404,7 @@ void CThreeWave::PlayerSpawn( CBasePlayer *pPlayer )
pPlayer->pev->flags |= FL_NOTARGET;
pPlayer->m_afPhysicsFlags |= PFLAG_OBSERVER;
pPlayer->m_iHideHUD |= HIDEHUD_WEAPONS | HIDEHUD_FLASHLIGHT | HIDEHUD_HEALTH;
pPlayer->m_flFlagStatusTime = gpGlobals->time + 0.1;
pPlayer->m_flFlagStatusTime = gpGlobals->time + 0.1f;
}
else
{
@ -453,7 +453,7 @@ void CThreeWave::PlayerSpawn( CBasePlayer *pPlayer )
pPlayer->m_iQuakeWeapon = pPlayer->W_BestWeapon();
pPlayer->W_SetCurrentAmmo();
pPlayer->m_flFlagStatusTime = gpGlobals->time + 0.1;
pPlayer->m_flFlagStatusTime = gpGlobals->time + 0.1f;
}
}
@ -655,7 +655,7 @@ void CThreeWave::ClientDisconnected( edict_t *pClient )
GetTeamName( pPlayer->pev->team ) );
}
pEnt->pev->velocity = pPlayer->pev->velocity * 1.2;
pEnt->pev->velocity = pPlayer->pev->velocity * 1.2f;
pEnt->pev->angles.x = 0;
CItemFlag *pFlag = (CItemFlag *)pEnt;
@ -674,7 +674,7 @@ void CThreeWave::ClientDisconnected( edict_t *pClient )
WRITE_STRING( STRING( pPlayer->pev->netname ) );
MESSAGE_END();
m_flFlagStatusTime = gpGlobals->time + 0.1;
m_flFlagStatusTime = gpGlobals->time + 0.1f;
pPlayer->m_bHasFlag = FALSE;
}
@ -685,7 +685,7 @@ void CThreeWave::ClientDisconnected( edict_t *pClient )
CItemRune *pRune = (CItemRune*)CBaseEntity::Create( g_RuneEntityName[pPlayer->m_iRuneStatus], pPlayer->pev->origin, pPlayer->pev->angles, pPlayer->edict() );
if( pRune )
{
pRune->pev->velocity = pPlayer->pev->velocity * 1.5;
pRune->pev->velocity = pPlayer->pev->velocity * 1.5f;
pRune->pev->angles.x = 0;
pRune->dropped = true;
@ -917,7 +917,7 @@ void CThreeWave::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, entvars
pVictim->m_bHasFlag = FALSE;
m_flFlagStatusTime = gpGlobals->time + 0.1;
m_flFlagStatusTime = gpGlobals->time + 0.1f;
}
else
{

View File

@ -43,7 +43,7 @@ void AgArena::Think()
if (!pPlayer1 || ( pPlayer1 && !pPlayer1->IsAlive() ) || !pPlayer2 || ( pPlayer2 && !pPlayer2->IsAlive() ) )
{
m_Status = PlayerDied;
m_fNextCountdown = gpGlobals->time + 3.0; //Let the effect of him dying play for 3 seconds
m_fNextCountdown = gpGlobals->time + 3.0f; //Let the effect of him dying play for 3 seconds
if (pPlayer1)
pPlayer1->SetIngame(false); //Cant respawn
@ -56,7 +56,7 @@ void AgArena::Think()
//We only update status once every second.
if (m_fNextCountdown > gpGlobals->time)
return;
m_fNextCountdown = gpGlobals->time + 1.0;
m_fNextCountdown = gpGlobals->time + 1.0f;
//Handle the status
if (Waiting == m_Status)
@ -85,8 +85,8 @@ void AgArena::Think()
if (GetPlayer1() && GetPlayer2())
{
m_Status = Countdown;
m_fMatchStart = gpGlobals->time + 5.0;
m_fNextCountdown = gpGlobals->time + 2.0;
m_fMatchStart = gpGlobals->time + 5.0f;
m_fNextCountdown = gpGlobals->time + 2.0f;
}

View File

@ -56,7 +56,7 @@ void AgSay(CBasePlayer* pPlayer,const AgString& sText, float* pfFloodProtected,
hText.r2 = hText.g2 = hText.b2 = 0;
hText.a2 = 0;
hText.holdTime = fHoldTime - 0.30;
hText.holdTime = fHoldTime - 0.30f;
hText.effect = 2; // Fade in/out
hText.fadeinTime = 0.01;

View File

@ -39,7 +39,7 @@ void AgLMS::Think()
{
if (m_fNextCountdown > gpGlobals->time)
return;
m_fNextCountdown = gpGlobals->time + 0.5;
m_fNextCountdown = gpGlobals->time + 0.5f;
if (g_pGameRules->IsTeamplay())
{
@ -134,7 +134,7 @@ void AgLMS::Think()
//We only update status once every second.
if (m_fNextCountdown > gpGlobals->time)
return;
m_fNextCountdown = gpGlobals->time + 1.0;
m_fNextCountdown = gpGlobals->time + 1.0f;
//Handle the status
if (Waiting == m_Status)
@ -155,8 +155,8 @@ void AgLMS::Think()
if (setTeams.size() > 1)
{
m_Status = Countdown;
m_fMatchStart = gpGlobals->time + 8.0;
m_fNextCountdown = gpGlobals->time + 3.0;
m_fMatchStart = gpGlobals->time + 8.0f;
m_fNextCountdown = gpGlobals->time + 3.0f;
}
}
else
@ -173,8 +173,8 @@ void AgLMS::Think()
if (iPlayers > 1)
{
m_Status = Countdown;
m_fMatchStart = gpGlobals->time + 8.0;
m_fNextCountdown = gpGlobals->time + 3.0;
m_fMatchStart = gpGlobals->time + 8.0f;
m_fNextCountdown = gpGlobals->time + 3.0f;
}
}

View File

@ -143,7 +143,7 @@ void CBasePlayer::Spectate_Start()
}
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
//Tell clients
UTIL_ClientPrintAll(HUD_PRINTNOTIFY, UTIL_VarArgs("%s entered spectator mode\n",GetName()));

View File

@ -15,7 +15,7 @@
AgTimer::AgTimer()
{
m_fNextTimerUpdate = gpGlobals->time + 5.0; //Dont start timer directly.
m_fNextTimerUpdate = gpGlobals->time + 5.0f; //Dont start timer directly.
m_fLastTimeCheck = gpGlobals->time;
m_fEffectiveTime = 0.0;
m_pmp_timelimit = CVAR_GET_POINTER("mp_timelimit");

View File

@ -88,7 +88,7 @@ void CBasePlayer::Observer_HandleButtons()
else
Observer_SetMode( OBS_CHASE_FREE ); // don't use OBS_CHASE_LOCKED anymore
m_flNextObserverInput = gpGlobals->time + 0.2;
m_flNextObserverInput = gpGlobals->time + 0.2f;
}
// Attack moves to the next player
@ -96,7 +96,7 @@ void CBasePlayer::Observer_HandleButtons()
{
Observer_FindNextPlayer();
m_flNextObserverInput = gpGlobals->time + 0.2;
m_flNextObserverInput = gpGlobals->time + 0.2f;
}
}

View File

@ -65,7 +65,7 @@ void CQuakeItem::Spawn()
if (DROP_TO_FLOOR(ENT(pev)) == 0)
{
ALERT(at_error, "Item %s fell out of level at %f,%f,%f", STRING( pev->classname ), pev->origin.x, pev->origin.y, pev->origin.z);
ALERT(at_error, "Item %s fell out of level at %f,%f,%f", STRING( pev->classname ), (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z);
UTIL_Remove( this );
return;
}

View File

@ -57,7 +57,7 @@ void CBasePlayer::UpdateStatusBar()
Vector vecEnd = vecSrc + (gpGlobals->v_forward * MAX_ID_RANGE);
UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, edict(), &tr);
if (tr.flFraction != 1.0)
if (tr.flFraction != 1.0f)
{
if ( !FNullEnt( tr.pHit ) )
{
@ -68,7 +68,7 @@ void CBasePlayer::UpdateStatusBar()
newSBarState[ SBAR_ID_TARGETNAME ] = ENTINDEX( pEntity->edict() );
newSBarState[ SBAR_ID_TARGETTEAM ] = FALSE;
m_flStatusBarDisappearDelay = gpGlobals->time + 1.0;
m_flStatusBarDisappearDelay = gpGlobals->time + 1.0f;
}
}
else if ( m_flStatusBarDisappearDelay > gpGlobals->time )

View File

@ -92,12 +92,12 @@ CQuakeRocket *CQuakeRocket::CreateGrenade( Vector vecOrigin, Vector vecVelocity,
// set newmis duration
if ( gpGlobals->deathmatch == 4 )
{
pRocket->m_flAttackFinished = gpGlobals->time + 1.1; // What's this used for?
pRocket->m_flAttackFinished = gpGlobals->time + 1.1f; // What's this used for?
if (pOwner)
pOwner->TakeDamage( pOwner->pev, pOwner->pev, 10, DMG_GENERIC );
}
pRocket->pev->nextthink = gpGlobals->time + 2.5;
pRocket->pev->nextthink = gpGlobals->time + 2.5f;
pRocket->SetThink( &CQuakeRocket::GrenadeExplode );
PLAYBACK_EVENT_FULL (FEV_GLOBAL, pRocket->edict(), g_sTrail, 0.0,

View File

@ -604,7 +604,7 @@ void CBasePlayer::Q_FireBullets(int iShots, Vector vecDir, Vector vecSpread)
UTIL_MakeVectors(pev->v_angle);
Vector vecSrc = pev->origin + (gpGlobals->v_forward * 10);
vecSrc.z = pev->absmin.z + (pev->size.z * 0.7);
vecSrc.z = pev->absmin.z + (pev->size.z * 0.7f);
ClearMultiDamage();
while ( iShots > 0 )
@ -612,7 +612,7 @@ void CBasePlayer::Q_FireBullets(int iShots, Vector vecDir, Vector vecSpread)
Vector vecPath = vecDir + ( RANDOM_FLOAT( -1, 1 ) * vecSpread.x * gpGlobals->v_right ) + ( RANDOM_FLOAT( -1, 1 ) * vecSpread.y * gpGlobals->v_up );
Vector vecEnd = vecSrc + ( vecPath * 2048 );
UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT(pev), &trace );
if (trace.flFraction != 1.0)
if (trace.flFraction != 1.0f)
{
CBaseEntity *pEntity = CBaseEntity::Instance(trace.pHit);
if (pEntity && pEntity->pev->takedamage && pEntity->IsPlayer() )
@ -644,14 +644,14 @@ void Q_RadiusDamage( CBaseEntity *pInflictor, CBaseEntity *pAttacker, float flDa
{
if (pEnt->pev->takedamage)
{
Vector vecOrg = pEnt->pev->origin + ((pEnt->pev->mins + pEnt->pev->maxs) * 0.5);
float flPoints = 0.5 * (pInflictor->pev->origin - vecOrg).Length();
Vector vecOrg = pEnt->pev->origin + ((pEnt->pev->mins + pEnt->pev->maxs) * 0.5f);
float flPoints = 0.5f * (pInflictor->pev->origin - vecOrg).Length();
if (flPoints < 0)
flPoints = 0;
flPoints = flDamage - flPoints;
if (pEnt == pAttacker)
flPoints = flPoints * 0.5;
flPoints = flPoints * 0.5f;
if (flPoints > 0)
{
if ( Q_CanDamage( pEnt, pInflictor ) )
@ -668,7 +668,7 @@ void LightningHit(CBaseEntity *pTarget, CBaseEntity *pAttacker, Vector vecHitPos
{
#ifndef CLIENT_DLL
SpawnBlood( vecHitPos, BLOOD_COLOR_RED, flDamage * 1.5 );
SpawnBlood( vecHitPos, BLOOD_COLOR_RED, flDamage * 1.5f );
if ( g_pGameRules->PlayerRelationship( pTarget, pAttacker ) != GR_TEAMMATE )
{
@ -734,9 +734,9 @@ void CBasePlayer::W_FireAxe()
// Swing forward 64 units
UTIL_MakeVectors(pev->v_angle);
UTIL_TraceLine( vecSrc, vecSrc + (gpGlobals->v_forward * 64), dont_ignore_monsters, ENT(pev), &trace );
if (trace.flFraction == 1.0)
if (trace.flFraction == 1.0f)
return;
Vector vecOrg = trace.vecEndPos - gpGlobals->v_forward * 4;
CBaseEntity *pEntity = CBaseEntity::Instance(trace.pHit);
@ -868,13 +868,13 @@ void CBasePlayer::W_FireLightning( int iQuadSound )
if ( m_flLightningTime <= gpGlobals->time )
{
playsound = true;
m_flLightningTime = gpGlobals->time + 0.6;
m_flLightningTime = gpGlobals->time + 0.6f;
}
// explode if under water
if (pev->waterlevel > 1)
{
if ( (gpGlobals->deathmatch > 3) && (RANDOM_FLOAT(0, 1) <= 0.5) )
if ( (gpGlobals->deathmatch > 3) && (RANDOM_FLOAT(0, 1) <= 0.5f) )
{
strcpy( gszQ_DeathType, "selfwater" );
TakeDamage( pev, pev, 4000, DMG_GENERIC );
@ -904,7 +904,7 @@ void CBasePlayer::W_FireLightning( int iQuadSound )
UTIL_MakeVectors( pev->v_angle );
UTIL_TraceLine( vecOrg, vecOrg + (gpGlobals->v_forward * 600), ignore_monsters, ENT(pev), &trace );
Vector vecDir = gpGlobals->v_forward + ( 0.001 * gpGlobals->v_right ) + ( 0.001 * gpGlobals->v_up );
Vector vecDir = gpGlobals->v_forward + ( 0.001f * gpGlobals->v_right ) + ( 0.001f * gpGlobals->v_up );
// Do damage
LightningDamage(pev->origin, trace.vecEndPos + (gpGlobals->v_forward * 4), this, 30, vecDir );
@ -918,7 +918,7 @@ void CBasePlayer::W_FireSuperSpikes( int iQuadSound )
if (gpGlobals->deathmatch != 4 )
*m_pCurrentAmmo -= 2;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1f;
// Fire the Nail
Vector vecDir = GetAutoaimVector( AUTOAIM_5DEGREES );
@ -943,7 +943,7 @@ void CBasePlayer::W_FireSpikes( int iQuadSound )
return;
}
PLAYBACK_EVENT_FULL( FEV_NOTHOST, edict(), m_usSpike, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, iQuadSound, 0, m_iNailOffset > 0.0 ? 1 : 0, 0 );
PLAYBACK_EVENT_FULL( FEV_NOTHOST, edict(), m_usSpike, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, iQuadSound, 0, m_iNailOffset > 0.0f ? 1 : 0, 0 );
// Fire left then right
if (m_iNailOffset == 2)
@ -953,7 +953,7 @@ void CBasePlayer::W_FireSpikes( int iQuadSound )
if (gpGlobals->deathmatch != 4 )
*m_pCurrentAmmo -= 1;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1f;
// Fire the nail
UTIL_MakeVectors( pev->v_angle );
@ -976,14 +976,14 @@ void CBasePlayer::W_Attack( int iQuadSound )
if (m_iQuakeWeapon == IT_AXE)
{
if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.3;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.3f;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
PLAYBACK_EVENT_FULL( FEV_NOTHOST, edict(), m_usAxeSwing, 0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, iQuadSound, 0, 0, 0 );
// Delay attack for 0.3
m_flAxeFire = gpGlobals->time + 0.3;
m_flAxeFire = gpGlobals->time + 0.3f;
PLAYBACK_EVENT_FULL( FEV_NOTHOST, edict(), m_usAxe, 0.3, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, iQuadSound, 0, 0, 0 );
@ -991,53 +991,53 @@ void CBasePlayer::W_Attack( int iQuadSound )
else if (m_iQuakeWeapon == IT_SHOTGUN)
{
if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.3;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.3f;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
W_FireShotgun( iQuadSound );
}
else if (m_iQuakeWeapon == IT_SUPER_SHOTGUN)
{
if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.4;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.4f;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.7;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.7f;
W_FireSuperShotgun( iQuadSound );
}
else if (m_iQuakeWeapon == IT_NAILGUN)
{
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1f;
W_FireSpikes( iQuadSound );
}
else if (m_iQuakeWeapon == IT_SUPER_NAILGUN)
{
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1f;
W_FireSpikes( iQuadSound );
}
else if (m_iQuakeWeapon == IT_GRENADE_LAUNCHER)
{
if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.3;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.3f;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.6;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.6f;
W_FireGrenade( iQuadSound );
}
else if (m_iQuakeWeapon == IT_ROCKET_LAUNCHER)
{
if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.4;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.4f;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.8;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.8f;
W_FireRocket( iQuadSound );
}
else if (m_iQuakeWeapon == IT_LIGHTNING)
{
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1f;
// Play the lightning start sound if gun just started firing
if (m_afButtonPressed & IN_ATTACK)
@ -1050,10 +1050,11 @@ void CBasePlayer::W_Attack( int iQuadSound )
if( !m_bHook_Out )
W_FireHook();
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1;
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1f;
}
// Make player attack
if ( pev->health >= 0 )
SetAnimation( PLAYER_ATTACK1 );
}

View File

@ -820,7 +820,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther )
// Don't play blocked sounds too often
if( m_fNextSoundPlay <= gpGlobals->time )
{
m_fNextSoundPlay = gpGlobals->time + 0.3;
m_fNextSoundPlay = gpGlobals->time + 0.3f;
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) );
}

View File

@ -258,10 +258,10 @@ void CHalfLifeMultiplay::Think( void )
m_Arena.Think();
//-- Martin Webrant
if( m_flGameEndTime != 0.0 && m_flGameEndTime <= gpGlobals->time )
if( m_flGameEndTime != 0.0f && m_flGameEndTime <= gpGlobals->time )
{
GoToIntermission();
m_flGameEndTime = 0.0;
m_flGameEndTime = 0.0f;
return;
}
@ -279,13 +279,13 @@ void CHalfLifeMultiplay::Think( void )
//time_remaining = (int)( flTimeLimit ? ( flTimeLimit - gpGlobals->time ) : 0 );
time_remaining = (int)( flTimeLimit ? ( flTimeLimit - gpGlobals->time + m_fGameStart ) : 0 );
//-- Martin Webrant
if( flTimeLimit != 0 && gpGlobals->time >= flTimeLimit && m_flGameEndTime == 0.0 )
if( flTimeLimit != 0 && gpGlobals->time >= flTimeLimit && m_flGameEndTime == 0.0f )
{
GoToIntermission();
return;
}
if( flFragLimit && m_flGameEndTime == 0.0 )
if( flFragLimit && m_flGameEndTime == 0.0f )
{
int bestfrags = 9999;
int remain;
@ -297,7 +297,7 @@ void CHalfLifeMultiplay::Think( void )
if( pPlayer && pPlayer->pev->frags >= flFragLimit )
{
m_flGameEndTime = gpGlobals->time + 1.5;
m_flGameEndTime = gpGlobals->time + 1.5f;
return;
}

View File

@ -291,7 +291,7 @@ void CBasePlayer::Pain( CBaseEntity *pAttacker )
if( pev->watertype == CONTENT_WATER && pev->waterlevel == 3 )
{
UTIL_Bubbles( pev->mins, pev->maxs, 3 );
if( RANDOM_FLOAT( 0, 1 ) > 0.5 )
if( RANDOM_FLOAT( 0, 1 ) > 0.5f )
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM );
else
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM );
@ -301,7 +301,7 @@ void CBasePlayer::Pain( CBaseEntity *pAttacker )
// slime pain sounds
if( pev->watertype == CONTENT_SLIME )
{
if( RANDOM_FLOAT( 0, 1 ) > 0.5 )
if( RANDOM_FLOAT( 0, 1 ) > 0.5f )
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM );
else
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM );
@ -311,7 +311,7 @@ void CBasePlayer::Pain( CBaseEntity *pAttacker )
// lava pain sounds
if( pev->watertype == CONTENT_LAVA )
{
if( RANDOM_FLOAT( 0, 1 ) > 0.5 )
if( RANDOM_FLOAT( 0, 1 ) > 0.5f )
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM );
else
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM );
@ -324,7 +324,7 @@ void CBasePlayer::Pain( CBaseEntity *pAttacker )
m_bAxHitMe = 0;
return;
}
m_flPainSoundFinished = gpGlobals->time + 0.5;
m_flPainSoundFinished = gpGlobals->time + 0.5f;
// ax pain sound
if( m_bAxHitMe == 1 )
@ -929,9 +929,9 @@ void CBasePlayer::WaterMove()
if( pev->dmgtime < gpGlobals->time )
{
if( m_iQuakeItems & IT_SUIT )
pev->dmgtime = gpGlobals->time + 1.0;
pev->dmgtime = gpGlobals->time + 1.0f;
else
pev->dmgtime = gpGlobals->time + 0.2;
pev->dmgtime = gpGlobals->time + 0.2f;
TakeDamage( VARS( eoNullEntity ), VARS( eoNullEntity ), 10 * pev->waterlevel, DMG_BURN );
}
}
@ -939,7 +939,7 @@ void CBasePlayer::WaterMove()
{
if( pev->dmgtime < gpGlobals->time )
{
pev->dmgtime = gpGlobals->time + 1.0;
pev->dmgtime = gpGlobals->time + 1.0f;
TakeDamage( VARS( eoNullEntity ), VARS( eoNullEntity ), 4 * pev->waterlevel, DMG_ACID );
}
}
@ -1001,7 +1001,7 @@ void CBasePlayer::PlayerDeathThink( void )
StopAnimation();
pev->effects |= EF_NOINTERP;
pev->framerate = 0.0;
pev->framerate = 0.0f;
//++ BulliT
//Remove sticky dead models.

View File

@ -880,7 +880,7 @@ void CBaseTrigger::EnvTouch( CBaseEntity *pOther )
pev->dmg = 4; //Default damage of 4
fldmg = (float)( pev->dmg * pOther->pev->waterlevel ); // pev->damage plus our current waterlevel
pev->dmgtime = gpGlobals->time + 1.0; //Next damage in 1 second
pev->dmgtime = gpGlobals->time + 1.0f; //Next damage in 1 second
}
//We are in lava
else if( m_bitsDamageInflict & DMG_BURN )
@ -891,12 +891,12 @@ void CBaseTrigger::EnvTouch( CBaseEntity *pOther )
if( pOther->IsPlayer() )
{
if( ( (CBasePlayer *)pOther )->m_iQuakeItems & IT_SUIT ) // Wearing the suit slows down the next damage time
pev->dmgtime = gpGlobals->time + 1.0;
pev->dmgtime = gpGlobals->time + 1.0f;
else
pev->dmgtime = gpGlobals->time + 0.2;
pev->dmgtime = gpGlobals->time + 0.2f;
}
else
pev->dmgtime = gpGlobals->time + 0.2;
pev->dmgtime = gpGlobals->time + 0.2f;
}
if( fldmg < 0 )
@ -2016,7 +2016,7 @@ void CTeleDeath::Spawn( void )
UTIL_SetOrigin( pev, pev->origin );
SetTouch( &CTeleDeath::DeathTouch );
pev->nextthink = gpGlobals->time + 0.2;
pev->nextthink = gpGlobals->time + 0.2f;
SetThink( &CBaseEntity::SUB_Remove );
// Touch still players
@ -2124,7 +2124,7 @@ void CBaseTrigger::TeleportTouch( CBaseEntity *pOther )
//pOther->pev->fixangle = 1; // turn this way immediately
//Err, why is this here?
pOther->pev->fuser4 = gpGlobals->time + 0.7;
pOther->pev->fuser4 = gpGlobals->time + 0.7f;
pOther->pev->velocity = gpGlobals->v_forward * 300;
}
pOther->pev->flags &= ~FL_ONGROUND;
@ -2152,7 +2152,7 @@ void CTriggerTeleport::Spawn( void )
if( !( pev->spawnflags & TELE_SILENT ) )
{
PRECACHE_SOUND( "ambience/hum1.wav" );
UTIL_EmitAmbientSound( ENT( pev ), ( pev->mins + pev->maxs ) * 0.5, "ambience/hum1.wav", 0.5, ATTN_STATIC, 0, 100 );
UTIL_EmitAmbientSound( ENT( pev ), ( pev->mins + pev->maxs ) * 0.5f, "ambience/hum1.wav", 0.5, ATTN_STATIC, 0, 100 );
}
}