Browse Source

Double promotion fixes.

sohl1.2
Andrey Akhmichin 5 years ago
parent
commit
aa9106ae72
  1. 2
      cl_dll/hud_msg.cpp
  2. 8
      cl_dll/tri.cpp
  3. 2
      dlls/bmodels.cpp
  4. 2
      dlls/buttons.cpp
  5. 2
      dlls/cbase.cpp
  6. 2
      dlls/client.cpp
  7. 16
      dlls/effects.cpp
  8. 2
      dlls/func_break.cpp
  9. 6
      dlls/func_tank.cpp
  10. 2
      dlls/gargantua.cpp
  11. 2
      dlls/genericmonster.cpp
  12. 2
      dlls/hassassin.cpp
  13. 2
      dlls/islave_deamon.cpp
  14. 32
      dlls/plats.cpp
  15. 6
      dlls/scripted.cpp
  16. 4
      dlls/sound.cpp
  17. 26
      dlls/triggers.cpp
  18. 2
      dlls/tripmine.cpp
  19. 8
      dlls/util.cpp

2
cl_dll/hud_msg.cpp

@ -164,7 +164,7 @@ void CHud :: MsgFunc_KeyedDLight( const char *pszName, int iSize, void *pbuf )
else else
{ {
// never die // never die
dl->die = gEngfuncs.GetClientTime() + 1E6; dl->die = gEngfuncs.GetClientTime() + (float)1E6;
dl->origin[0] = READ_COORD(); dl->origin[0] = READ_COORD();
dl->origin[1] = READ_COORD(); dl->origin[1] = READ_COORD();

8
cl_dll/tri.cpp

@ -105,13 +105,13 @@ void CShinySurface::Draw(const vec3_t &org)
// gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, m_fAlpha ); // gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, m_fAlpha );
gEngfuncs.pTriAPI->Begin( TRI_QUADS ); gEngfuncs.pTriAPI->Begin( TRI_QUADS );
gEngfuncs.pTriAPI->TexCoord2f( fMinTX, fMinTY ); gEngfuncs.pTriAPI->TexCoord2f( fMinTX, fMinTY );
gEngfuncs.pTriAPI->Vertex3f ( m_fMinX, m_fMinY, m_fZ+0.02 ); // add 0.02 to avoid z-buffer problems gEngfuncs.pTriAPI->Vertex3f ( m_fMinX, m_fMinY, m_fZ+0.02f ); // add 0.02 to avoid z-buffer problems
gEngfuncs.pTriAPI->TexCoord2f( fMinTX, fMaxTY ); gEngfuncs.pTriAPI->TexCoord2f( fMinTX, fMaxTY );
gEngfuncs.pTriAPI->Vertex3f ( m_fMinX, m_fMaxY, m_fZ+0.02 ); gEngfuncs.pTriAPI->Vertex3f ( m_fMinX, m_fMaxY, m_fZ+0.02f );
gEngfuncs.pTriAPI->TexCoord2f( fMaxTX, fMaxTY ); gEngfuncs.pTriAPI->TexCoord2f( fMaxTX, fMaxTY );
gEngfuncs.pTriAPI->Vertex3f ( m_fMaxX, m_fMaxY, m_fZ+0.02 ); gEngfuncs.pTriAPI->Vertex3f ( m_fMaxX, m_fMaxY, m_fZ+0.02f );
gEngfuncs.pTriAPI->TexCoord2f( fMaxTX, fMinTY ); gEngfuncs.pTriAPI->TexCoord2f( fMaxTX, fMinTY );
gEngfuncs.pTriAPI->Vertex3f ( m_fMaxX, m_fMinY, m_fZ+0.02 ); gEngfuncs.pTriAPI->Vertex3f ( m_fMaxX, m_fMinY, m_fZ+0.02f );
gEngfuncs.pTriAPI->End(); gEngfuncs.pTriAPI->End();
} }

2
dlls/bmodels.cpp

@ -300,7 +300,7 @@ void CFuncShine :: DesiredAction( void )
if (pev->message && pev->renderamt) if (pev->message && pev->renderamt)
{ {
// ALERT(at_console, "Prepare think\n"); // ALERT(at_console, "Prepare think\n");
pev->nextthink = gpGlobals->time + 1.5; pev->nextthink = gpGlobals->time + 1.5f;
} }
} }

2
dlls/buttons.cpp

@ -218,7 +218,7 @@ void CEnvState::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
m_iState = STATE_TURN_OFF; m_iState = STATE_TURN_OFF;
if (pev->spawnflags & SF_ENVSTATE_DEBUG) if (pev->spawnflags & SF_ENVSTATE_DEBUG)
{ {
ALERT(at_console,"DEBUG: env_state \"%s\" triggered; will turn off in %f seconds.\n", STRING(pev->targetname), m_fTurnOffTime); ALERT(at_console,"DEBUG: env_state \"%s\" triggered; will turn off in %f seconds.\n", STRING(pev->targetname), (float)m_fTurnOffTime);
} }
SetNextThink( m_fTurnOffTime ); SetNextThink( m_fTurnOffTime );
} }

2
dlls/cbase.cpp

@ -599,7 +599,7 @@ void CBaseEntity :: SetEternalThink( void )
// record m_fPevNextThink as well, because we want to be able to // record m_fPevNextThink as well, because we want to be able to
// tell when the bloody engine CHANGES IT! // tell when the bloody engine CHANGES IT!
// pev->nextthink = 1E9; // pev->nextthink = 1E9;
pev->nextthink = pev->ltime + 1E6; pev->nextthink = pev->ltime + (float)1E6;
m_fPevNextThink = pev->nextthink; m_fPevNextThink = pev->nextthink;
} }

2
dlls/client.cpp

@ -549,7 +549,7 @@ void ClientCommand( edict_t *pEntity )
} }
else if ( FStrEq(pcmd, "give" ) ) else if ( FStrEq(pcmd, "give" ) )
{ {
if ( g_flWeaponCheat != 0.0) if ( g_flWeaponCheat != 0.0f )
{ {
int iszItem = ALLOC_STRING( CMD_ARGV(1) ); // Make a copy of the classname int iszItem = ALLOC_STRING( CMD_ARGV(1) ); // Make a copy of the classname
GetClassPtr((CBasePlayer *)pev)->GiveNamedItem( STRING(iszItem) ); GetClassPtr((CBasePlayer *)pev)->GiveNamedItem( STRING(iszItem) );

16
dlls/effects.cpp

@ -781,7 +781,7 @@ CBaseEntity* CBeam::GetTripEntity( TraceResult *ptr )
{ {
CBaseEntity* pTrip; CBaseEntity* pTrip;
if (ptr->flFraction == 1.0 || ptr->pHit == NULL) if (ptr->flFraction == 1.0f || ptr->pHit == NULL)
return NULL; return NULL;
pTrip = CBaseEntity::Instance(ptr->pHit); pTrip = CBaseEntity::Instance(ptr->pHit);
@ -2143,7 +2143,7 @@ void CShot :: Touch ( CBaseEntity *pOther )
return; return;
// don't fire too often in collisions! // don't fire too often in collisions!
// teleport_time is the soonest this can be touched again. // teleport_time is the soonest this can be touched again.
pev->teleport_time = gpGlobals->time + 0.1; pev->teleport_time = gpGlobals->time + 0.1f;
if (pev->netname) if (pev->netname)
FireTargets( STRING(pev->netname), this, this, USE_TOGGLE, 0 ); FireTargets( STRING(pev->netname), this, this, USE_TOGGLE, 0 );
@ -2343,7 +2343,7 @@ CBaseEntity *CEnvShooter :: CreateGib ( Vector vecPos, Vector vecVel )
if (pShot->pev->framerate) if (pShot->pev->framerate)
{ {
pShot->m_maxFrame = (float) MODEL_FRAMES( pShot->pev->modelindex ) - 1; pShot->m_maxFrame = (float) MODEL_FRAMES( pShot->pev->modelindex ) - 1;
if (pShot->m_maxFrame > 1.0) if (pShot->m_maxFrame > 1.0f)
{ {
if (m_flGibLife) if (m_flGibLife)
{ {
@ -3534,12 +3534,12 @@ void CEnvRain::Think( void )
break; break;
case EXTENT_ARCING: case EXTENT_ARCING:
UTIL_TraceLine( vecSrc, vecDest, ignore_monsters, NULL, &tr); UTIL_TraceLine( vecSrc, vecDest, ignore_monsters, NULL, &tr);
if (tr.flFraction == 1.0) bDraw = FALSE; if (tr.flFraction == 1.0f) bDraw = FALSE;
vecDest = tr.vecEndPos; vecDest = tr.vecEndPos;
break; break;
case EXTENT_ARCING_REVERSE: case EXTENT_ARCING_REVERSE:
UTIL_TraceLine( vecDest, vecSrc, ignore_monsters, NULL, &tr); UTIL_TraceLine( vecDest, vecSrc, ignore_monsters, NULL, &tr);
if (tr.flFraction == 1.0) bDraw = FALSE; if (tr.flFraction == 1.0f) bDraw = FALSE;
vecSrc = tr.vecEndPos; vecSrc = tr.vecEndPos;
break; break;
} }
@ -3620,7 +3620,7 @@ void CEnvWarpBall::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
{ {
vecDest = pev->health * (Vector(RANDOM_FLOAT(-1,1), RANDOM_FLOAT(-1,1), RANDOM_FLOAT(-1,1)).Normalize()); vecDest = pev->health * (Vector(RANDOM_FLOAT(-1,1), RANDOM_FLOAT(-1,1), RANDOM_FLOAT(-1,1)).Normalize());
UTIL_TraceLine( pev->origin, pev->origin + vecDest, ignore_monsters, NULL, &tr); UTIL_TraceLine( pev->origin, pev->origin + vecDest, ignore_monsters, NULL, &tr);
if (tr.flFraction != 1.0) if (tr.flFraction != 1.0f)
{ {
// we hit something. // we hit something.
iDrawn++; iDrawn++;
@ -4063,7 +4063,7 @@ void CEnvDecal::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
UTIL_TraceLine( vecPos, vecPos+vecOffs, ignore_monsters, NULL, &trace ); UTIL_TraceLine( vecPos, vecPos+vecOffs, ignore_monsters, NULL, &trace );
if (trace.flFraction == 1.0) if (trace.flFraction == 1.0f)
return; // didn't hit anything, oh well return; // didn't hit anything, oh well
entityIndex = (short)ENTINDEX(trace.pHit); entityIndex = (short)ENTINDEX(trace.pHit);
@ -4485,7 +4485,7 @@ public:
void CEnvSky :: Activate ( void ) void CEnvSky :: Activate ( void )
{ {
pev->effects |= EF_NODRAW; pev->effects |= EF_NODRAW;
pev->nextthink = gpGlobals->time + 1.0; pev->nextthink = gpGlobals->time + 1.0f;
} }
extern int gmsgSetSky; extern int gmsgSetSky;

2
dlls/func_break.cpp

@ -1135,7 +1135,7 @@ void CPushable::Move( CBaseEntity *pOther, int push )
factor = 0.25f; factor = 0.25f;
if (!push) if (!push)
factor = factor*0.5; factor *= 0.5f;
pev->velocity.x += pevToucher->velocity.x * factor; pev->velocity.x += pevToucher->velocity.x * factor;
pev->velocity.y += pevToucher->velocity.y * factor; pev->velocity.y += pevToucher->velocity.y * factor;

6
dlls/func_tank.cpp

@ -1056,7 +1056,7 @@ void CFuncTank::TrackTarget( void )
UTIL_SetAvelocity(this, setAVel); UTIL_SetAvelocity(this, setAVel);
// notify the TankSequence if we're (pretty close to) facing the target // notify the TankSequence if we're (pretty close to) facing the target
if( m_pSequence && fabs( distY ) < 0.1 && fabs( distX ) < 0.1 ) if( m_pSequence && fabs( distY ) < 0.1f && fabs( distX ) < 0.1f )
m_pSequence->FacingNotify(); m_pSequence->FacingNotify();
// firing in tanksequences: // firing in tanksequences:
@ -1070,7 +1070,7 @@ void CFuncTank::TrackTarget( void )
UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL ); UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL );
// to make sure the gun doesn't fire too many bullets // to make sure the gun doesn't fire too many bullets
m_fireLast = gpGlobals->time - (1/m_fireRate) - 0.01; m_fireLast = gpGlobals->time - (1/m_fireRate) - 0.01f;
TryFire( BarrelPosition(), forward, pev ); TryFire( BarrelPosition(), forward, pev );
@ -1093,7 +1093,7 @@ void CFuncTank::TrackTarget( void )
UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL ); UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL );
// to make sure the gun doesn't fire too many bullets // to make sure the gun doesn't fire too many bullets
m_fireLast = gpGlobals->time - (1/m_fireRate) - 0.01; m_fireLast = gpGlobals->time - (1/m_fireRate) - 0.01f;
TryFire( BarrelPosition(), forward, pController->pev ); TryFire( BarrelPosition(), forward, pController->pev );

2
dlls/gargantua.cpp

@ -1089,7 +1089,7 @@ void CGargantua::StartTask( Task_t *pTask )
if ( m_pCine->IsAction() && m_pCine->m_fAction == 3) if ( m_pCine->IsAction() && m_pCine->m_fAction == 3)
{ {
FlameCreate(); FlameCreate();
m_flWaitFinished = gpGlobals->time + 4.5; m_flWaitFinished = gpGlobals->time + 4.5f;
m_flameTime = gpGlobals->time + 6; m_flameTime = gpGlobals->time + 6;
m_flameX = 0; m_flameX = 0;
m_flameY = 0; m_flameY = 0;

2
dlls/genericmonster.cpp

@ -142,7 +142,7 @@ void CGenericMonster::Spawn()
if (pev->targetname) if (pev->targetname)
ALERT(at_error, "No model specified for monster_generic \"%s\"\n", STRING(pev->targetname)); ALERT(at_error, "No model specified for monster_generic \"%s\"\n", STRING(pev->targetname));
else else
ALERT(at_error, "No model specified for monster_generic at %.2f %.2f %.2f\n", pev->origin.x, pev->origin.y, pev->origin.z); ALERT(at_error, "No model specified for monster_generic at %.2f %.2f %.2f\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z);
pev->model = MAKE_STRING("models/player.mdl"); pev->model = MAKE_STRING("models/player.mdl");
} }

2
dlls/hassassin.cpp

@ -296,7 +296,7 @@ void CHAssassin::HandleAnimEvent( MonsterEvent_t *pEvent )
{ // just jump, it doesn't matter where to. { // just jump, it doesn't matter where to.
//ALERT(at_console,"Nonprecise jump for assassin %s\n",STRING(pev->targetname)); //ALERT(at_console,"Nonprecise jump for assassin %s\n",STRING(pev->targetname));
float flGravity = g_psv_gravity->value; float flGravity = g_psv_gravity->value;
float time = sqrt( 160 / (0.5 * flGravity)); float time = sqrt( 160 / (0.5f * flGravity));
float speed = flGravity * time / 160; float speed = flGravity * time / 160;
UTIL_MakeVectors(pev->angles); UTIL_MakeVectors(pev->angles);
Vector vecDest = pev->origin + (gpGlobals->v_forward * 32); Vector vecDest = pev->origin + (gpGlobals->v_forward * 32);

2
dlls/islave_deamon.cpp

@ -484,7 +484,7 @@ BOOL CISlave :: CheckRangeAttack2 ( float flDot, float flDist )
TraceResult tr; TraceResult tr;
UTIL_TraceLine( EyePosition(), pEntity->EyePosition(), ignore_monsters, ENT( pev ), &tr ); UTIL_TraceLine( EyePosition(), pEntity->EyePosition(), ignore_monsters, ENT( pev ), &tr );
if( tr.flFraction == 1.0 || tr.pHit == pEntity->edict() ) if( tr.flFraction == 1.0f || tr.pHit == pEntity->edict() )
{ {
if (pEntity->pev->deadflag == DEAD_DEAD) if (pEntity->pev->deadflag == DEAD_DEAD)
{ {

32
dlls/plats.cpp

@ -971,11 +971,11 @@ void CFuncTrain::Next( void )
{ {
case PATHSPEED_SET: case PATHSPEED_SET:
pev->speed = m_pevCurrentTarget->speed; pev->speed = m_pevCurrentTarget->speed;
ALERT( at_aiconsole, "Train %s speed set to %4.2f\n", STRING(pev->targetname), pev->speed ); ALERT( at_aiconsole, "Train %s speed set to %4.2f\n", STRING(pev->targetname), (double)pev->speed );
break; break;
case PATHSPEED_ACCEL: case PATHSPEED_ACCEL:
pev->speed += m_pevCurrentTarget->speed; pev->speed += m_pevCurrentTarget->speed;
ALERT( at_aiconsole, "Train %s speed accel to %4.2f\n", STRING(pev->targetname), pev->speed ); ALERT( at_aiconsole, "Train %s speed accel to %4.2f\n", STRING(pev->targetname), (double)pev->speed );
break; break;
case PATHSPEED_TIME: case PATHSPEED_TIME:
float distance; float distance;
@ -985,7 +985,7 @@ void CFuncTrain::Next( void )
distance = (pev->origin - (pTarg->pev->origin - (pev->mins + pev->maxs) * 0.5f)).Length(); distance = (pev->origin - (pTarg->pev->origin - (pev->mins + pev->maxs) * 0.5f)).Length();
pev->speed = distance / m_pevCurrentTarget->speed; pev->speed = distance / m_pevCurrentTarget->speed;
ALERT( at_aiconsole, "Train %s speed to %4.2f (timed)\n", STRING(pev->targetname), pev->speed ); ALERT( at_aiconsole, "Train %s speed to %4.2f (timed)\n", STRING(pev->targetname), (double)pev->speed );
break; break;
} }
} }
@ -1020,7 +1020,7 @@ void CFuncTrain::Next( void )
} }
else else
{ {
if (pev->spawnflags & SF_TRAIN_SETORIGIN) if (pev->spawnflags & SF_TRAIN_SETORIGIN)
UTIL_AssignOrigin(this, pTarg->pev->origin ); UTIL_AssignOrigin(this, pTarg->pev->origin );
else else
UTIL_AssignOrigin(this, pTarg->pev->origin - (pev->mins + pev->maxs) * 0.5f ); UTIL_AssignOrigin(this, pTarg->pev->origin - (pev->mins + pev->maxs) * 0.5f );
@ -1125,11 +1125,11 @@ void CFuncTrain :: PostSpawn( void )
} }
else else
{ {
m_vecSpawnOffset = m_vecSpawnOffset + (pevTarg->origin - (pev->mins + pev->maxs) * 0.5) - pev->origin; m_vecSpawnOffset = m_vecSpawnOffset + (pevTarg->origin - (pev->mins + pev->maxs) * 0.5f) - pev->origin;
if (m_pMoveWith) if (m_pMoveWith)
UTIL_AssignOrigin (this, pevTarg->origin - (pev->mins + pev->maxs) * 0.5 - m_pMoveWith->pev->origin ); UTIL_AssignOrigin (this, pevTarg->origin - (pev->mins + pev->maxs) * 0.5f - m_pMoveWith->pev->origin );
else else
UTIL_AssignOrigin (this, pevTarg->origin - (pev->mins + pev->maxs) * 0.5 ); UTIL_AssignOrigin (this, pevTarg->origin - (pev->mins + pev->maxs) * 0.5f );
} }
if( FStringNull( pev->targetname ) || pev->spawnflags & SF_TRAIN_START_ON ) if( FStringNull( pev->targetname ) || pev->spawnflags & SF_TRAIN_START_ON )
@ -1149,9 +1149,9 @@ void CFuncTrain :: PostSpawn( void )
void CFuncTrain :: ThinkDoNext( void ) void CFuncTrain :: ThinkDoNext( void )
{ {
SetNextThink( 0.1 ); SetNextThink( 0.1f );
// ALERT(at_console, "TDN "); // ALERT(at_console, "TDN ");
if (gpGlobals->time != 1.0) // only go on if the game has properly started yet if (gpGlobals->time != 1.0f) // only go on if the game has properly started yet
SetThink(&CFuncTrain :: Next ); SetThink(&CFuncTrain :: Next );
} }
@ -1364,8 +1364,8 @@ void CFuncTrackTrain :: Spawn( void )
void CFuncTrackTrain :: Precache( void ) void CFuncTrackTrain :: Precache( void )
{ {
if (m_flVolume == 0.0) if (m_flVolume == 0.0f)
m_flVolume = 1.0; m_flVolume = 1.0f;
switch (m_sounds) switch (m_sounds)
{ {
@ -1554,7 +1554,7 @@ void CFuncTrackTrain::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY
} }
PostponeNext(); PostponeNext();
ALERT( at_aiconsole, "TRAIN(%s), speed to %.2f\n", STRING(pev->targetname), pev->speed ); ALERT( at_aiconsole, "TRAIN(%s), speed to %.2f\n", STRING(pev->targetname), (double)pev->speed );
} }
} }
@ -1820,19 +1820,19 @@ void CFuncTrackTrain :: DesiredAction( void ) // Next( void )
// Don't override speed if under user control // Don't override speed if under user control
if (pev->spawnflags & SF_TRACKTRAIN_NOCONTROL) if (pev->spawnflags & SF_TRACKTRAIN_NOCONTROL)
pev->speed = pFire->pev->speed; pev->speed = pFire->pev->speed;
ALERT( at_aiconsole, "TrackTrain %s speed set to %4.2f\n", STRING(pev->targetname), pev->speed ); ALERT( at_aiconsole, "TrackTrain %s speed set to %4.2f\n", STRING(pev->targetname), (double)pev->speed );
break; break;
case PATHSPEED_SET_MASTER: case PATHSPEED_SET_MASTER:
m_speed = pFire->pev->speed; m_speed = pFire->pev->speed;
pev->impulse = m_speed; pev->impulse = m_speed;
pev->speed = setting * m_speed; pev->speed = setting * m_speed;
ALERT( at_aiconsole, "TrackTrain %s master speed set to %4.2f\n", STRING(pev->targetname), pev->speed ); ALERT( at_aiconsole, "TrackTrain %s master speed set to %4.2f\n", STRING(pev->targetname), (double)pev->speed );
break; break;
case PATHSPEED_ACCEL: case PATHSPEED_ACCEL:
m_speed += pFire->pev->speed; m_speed += pFire->pev->speed;
pev->impulse = m_speed; pev->impulse = m_speed;
pev->speed = setting * m_speed; pev->speed = setting * m_speed;
ALERT( at_aiconsole, "TrackTrain %s speed accel to %4.2f\n", STRING(pev->targetname), pev->speed ); ALERT( at_aiconsole, "TrackTrain %s speed accel to %4.2f\n", STRING(pev->targetname), (double)pev->speed );
break; break;
case PATHSPEED_TIME: case PATHSPEED_TIME:
float distance = (pev->origin - pDest->pev->origin).Length(); float distance = (pev->origin - pDest->pev->origin).Length();
@ -1840,7 +1840,7 @@ void CFuncTrackTrain :: DesiredAction( void ) // Next( void )
m_speed = distance / pFire->pev->speed; m_speed = distance / pFire->pev->speed;
pev->impulse = m_speed; pev->impulse = m_speed;
pev->speed = setting * m_speed; pev->speed = setting * m_speed;
ALERT( at_aiconsole, "TrackTrain %s speed to %4.2f (timed)\n", STRING(pev->targetname), pev->speed ); ALERT( at_aiconsole, "TrackTrain %s speed to %4.2f (timed)\n", STRING(pev->targetname), (double)pev->speed );
break; break;
} }
} }

6
dlls/scripted.cpp

@ -449,14 +449,14 @@ void CCineMonster :: InitIdleThink( void )
if ((m_hTargetEnt = FindEntity(STRING(m_iszEntity), NULL)) != NULL) if ((m_hTargetEnt = FindEntity(STRING(m_iszEntity), NULL)) != NULL)
{ {
PossessEntity( ); PossessEntity( );
m_startTime = gpGlobals->time + 1E6; m_startTime = gpGlobals->time + (float)1E6;
ALERT( at_aiconsole, "script \"%s\" using monster \"%s\"\n", STRING( pev->targetname ), STRING( m_iszEntity ) ); ALERT( at_aiconsole, "script \"%s\" using monster \"%s\"\n", STRING( pev->targetname ), STRING( m_iszEntity ) );
} }
else else
{ {
CancelScript( ); CancelScript( );
ALERT( at_aiconsole, "script \"%s\" can't find monster \"%s\"\n", STRING( pev->targetname ), STRING( m_iszEntity ) ); ALERT( at_aiconsole, "script \"%s\" can't find monster \"%s\"\n", STRING( pev->targetname ), STRING( m_iszEntity ) );
SetNextThink( 1.0 ); SetNextThink( 1.0f );
} }
} }
@ -690,7 +690,7 @@ void CCineMonster::DelayStart( int state )
{ {
pTarget->m_iState = STATE_ON; //LRC pTarget->m_iState = STATE_ON; //LRC
FireTargets(STRING(m_iszFireOnBegin), this, this, USE_TOGGLE, 0); //LRC FireTargets(STRING(m_iszFireOnBegin), this, this, USE_TOGGLE, 0); //LRC
pTarget->m_startTime = gpGlobals->time + 0.05; // why the delay? -- LRC pTarget->m_startTime = gpGlobals->time + 0.05f; // why the delay? -- LRC
} }
} }
} }

4
dlls/sound.cpp

@ -195,7 +195,7 @@ void CAmbientGeneric::Spawn( void )
if( FStringNull( pev->message ) || szSoundFile[0] == '\0' ) if( FStringNull( pev->message ) || szSoundFile[0] == '\0' )
{ {
ALERT( at_error, "ambient_generic \"%s\" at (%f, %f, %f) has no sound file\n", ALERT( at_error, "ambient_generic \"%s\" at (%f, %f, %f) has no sound file\n",
STRING(pev->targetname), pev->origin.x, pev->origin.y, pev->origin.z ); STRING(pev->targetname), (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z );
SetNextThink( 0.1f ); SetNextThink( 0.1f );
SetThink( &CAmbientGeneric::SUB_Remove ); SetThink( &CAmbientGeneric::SUB_Remove );
return; return;
@ -1919,7 +1919,7 @@ void CSpeaker::Spawn( void )
if( !m_preset && ( FStringNull( pev->message ) || szSoundFile[0] == '\0' ) ) if( !m_preset && ( FStringNull( pev->message ) || szSoundFile[0] == '\0' ) )
{ {
ALERT( at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z ); ALERT( at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z );
SetNextThink( 0.1f ); SetNextThink( 0.1f );
SetThink( &CSpeaker::SUB_Remove ); SetThink( &CSpeaker::SUB_Remove );
return; return;

26
dlls/triggers.cpp

@ -432,7 +432,7 @@ void CTriggerRotTest::Think( void )
// ALERT(at_console, "vecTemp = %.2f %.2f %.2f\n", vecTemp.x, vecTemp.y, vecTemp.z); // ALERT(at_console, "vecTemp = %.2f %.2f %.2f\n", vecTemp.x, vecTemp.y, vecTemp.z);
// ALERT(at_console, "Set Marker = %.2f %.2f %.2f\n", m_pMarker->pev->origin.x, m_pMarker->pev->origin.y, m_pMarker->pev->origin.z); // ALERT(at_console, "Set Marker = %.2f %.2f %.2f\n", m_pMarker->pev->origin.x, m_pMarker->pev->origin.y, m_pMarker->pev->origin.z);
} }
pev->armorvalue += pev->armortype * 0.1; pev->armorvalue += pev->armortype * 0.1f;
SetNextThink( 0.1 ); SetNextThink( 0.1 );
} }
@ -2333,7 +2333,7 @@ void CTriggerHurt :: HurtTouch ( CBaseEntity *pOther )
// while touching the trigger. Player continues taking damage for a while after // while touching the trigger. Player continues taking damage for a while after
// leaving the trigger // leaving the trigger
fldmg = pev->dmg * 0.5; // 0.5 seconds worth of damage, pev->dmg is damage/second fldmg = pev->dmg * 0.5f; // 0.5 seconds worth of damage, pev->dmg is damage/second
// JAY: Cut this because it wasn't fully realized. Damage is simpler now. // JAY: Cut this because it wasn't fully realized. Damage is simpler now.
@ -2360,7 +2360,7 @@ void CTriggerHurt :: HurtTouch ( CBaseEntity *pOther )
pev->pain_finished = gpGlobals->time; pev->pain_finished = gpGlobals->time;
// Apply damage every half second // Apply damage every half second
pev->dmgtime = gpGlobals->time + 0.5;// half second delay until this trigger can hurt toucher again pev->dmgtime = gpGlobals->time + 0.5f;// half second delay until this trigger can hurt toucher again
@ -2406,8 +2406,8 @@ void CTriggerHurt :: RadiationThink( void )
origin = pev->origin; origin = pev->origin;
view_ofs = pev->view_ofs; view_ofs = pev->view_ofs;
pev->origin = (pev->absmin + pev->absmax) * 0.5; pev->origin = (pev->absmin + pev->absmax) * 0.5f;
pev->view_ofs = pev->view_ofs * 0.0; pev->view_ofs = pev->view_ofs * 0.0f;
pentPlayer = FIND_CLIENT_IN_PVS(edict()); pentPlayer = FIND_CLIENT_IN_PVS(edict());
@ -2425,9 +2425,9 @@ void CTriggerHurt :: RadiationThink( void )
// get range to player; // get range to player;
vecSpot1 = (pev->absmin + pev->absmax) * 0.5; vecSpot1 = (pev->absmin + pev->absmax) * 0.5f;
vecSpot2 = (pevTarget->absmin + pevTarget->absmax) * 0.5; vecSpot2 = (pevTarget->absmin + pevTarget->absmax) * 0.5f;
vecRange = vecSpot1 - vecSpot2; vecRange = vecSpot1 - vecSpot2;
flRange = vecRange.Length(); flRange = vecRange.Length();
@ -2439,7 +2439,7 @@ void CTriggerHurt :: RadiationThink( void )
pPlayer->m_flgeigerRange = flRange; pPlayer->m_flgeigerRange = flRange;
} }
SetNextThink( 0.25 ); SetNextThink( 0.25f );
} }
//===================================== //=====================================
@ -2492,7 +2492,7 @@ void CTriggerHevCharge :: ChargeTouch ( CBaseEntity *pOther )
//FIXME: add in the multiplayer fix, from trigger_hurt? //FIXME: add in the multiplayer fix, from trigger_hurt?
if ( pev->dmgtime > gpGlobals->time ) if ( pev->dmgtime > gpGlobals->time )
return; return;
pev->dmgtime = gpGlobals->time + 0.5;// half second delay until this trigger can hurt toucher again pev->dmgtime = gpGlobals->time + 0.5f;// half second delay until this trigger can hurt toucher again
int iNewArmor = pOther->pev->armorvalue + pev->frags; int iNewArmor = pOther->pev->armorvalue + pev->frags;
if (iNewArmor > MAX_NORMAL_BATTERY) iNewArmor = MAX_NORMAL_BATTERY; if (iNewArmor > MAX_NORMAL_BATTERY) iNewArmor = MAX_NORMAL_BATTERY;
@ -2535,7 +2535,7 @@ void CTriggerHevCharge :: AnnounceThink ( )
// Suit reports new power level // Suit reports new power level
// For some reason this wasn't working in release build -- round it. // For some reason this wasn't working in release build -- round it.
pct = (int)( (float)(pPlayer->pev->armorvalue * 100.0) * (1.0/MAX_NORMAL_BATTERY) + 0.5); pct = (int)( (float)(pPlayer->pev->armorvalue * 100.0f) * (1.0f/MAX_NORMAL_BATTERY) + 0.5f);
pct = (pct / 5); pct = (pct / 5);
if (pct > 0) if (pct > 0)
pct--; pct--;
@ -3893,7 +3893,7 @@ void CTriggerOnSight :: Spawn( void )
if (pev->max_health > 0) if (pev->max_health > 0)
{ {
pev->health = cos(pev->max_health/2 * M_PI/180.0); pev->health = cos(pev->max_health/2 * M_PI_F/180.0f);
// ALERT(at_console, "Cosine is %f\n", pev->health); // ALERT(at_console, "Cosine is %f\n", pev->health);
} }
} }
@ -4029,7 +4029,7 @@ BOOL CTriggerOnSight :: CanSee(CBaseEntity *pLooker, CBaseEntity *pSeen)
UTIL_TraceLine( pLooker->EyePosition(), pSeen->pev->origin, ignore_monsters, ignore_glass, pLooker->edict(), &tr ); UTIL_TraceLine( pLooker->EyePosition(), pSeen->pev->origin, ignore_monsters, ignore_glass, pLooker->edict(), &tr );
else else
UTIL_TraceLine( pLooker->EyePosition(), pSeen->pev->origin, ignore_monsters, dont_ignore_glass, pLooker->edict(), &tr ); UTIL_TraceLine( pLooker->EyePosition(), pSeen->pev->origin, ignore_monsters, dont_ignore_glass, pLooker->edict(), &tr );
if (tr.flFraction < 1.0 && tr.pHit != pSeen->edict()) if (tr.flFraction < 1.0f && tr.pHit != pSeen->edict())
return FALSE; return FALSE;
} }

2
dlls/tripmine.cpp

@ -196,7 +196,7 @@ void CTripmineGrenade::PowerupThink( void )
STOP_SOUND( ENT( pev ), CHAN_BODY, "weapons/mine_charge.wav" ); STOP_SOUND( ENT( pev ), CHAN_BODY, "weapons/mine_charge.wav" );
SetThink( &CTripmineGrenade::SUB_Remove ); SetThink( &CTripmineGrenade::SUB_Remove );
SetNextThink( 0.1f ); SetNextThink( 0.1f );
ALERT( at_console, "WARNING:Tripmine at %.0f, %.0f, %.0f removed\n", pev->origin.x, pev->origin.y, pev->origin.z ); ALERT( at_console, "WARNING:Tripmine at %.0f, %.0f, %.0f removed\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z );
KillBeam(); KillBeam();
return; return;
} }

8
dlls/util.cpp

@ -394,8 +394,8 @@ Vector UTIL_AxisRotationToAngles( const Vector &vecAxis, float flDegs )
Vector vecTemp = UTIL_AxisRotationToVec( vecAxis, flDegs ); Vector vecTemp = UTIL_AxisRotationToVec( vecAxis, flDegs );
float rgflVecOut[3]; float rgflVecOut[3];
//ugh, mathsy. //ugh, mathsy.
rgflVecOut[0] = asin(vecTemp.z) * (-180.0 / M_PI); rgflVecOut[0] = asin(vecTemp.z) * (-180.0f / M_PI_F);
rgflVecOut[1] = acos(vecTemp.x) * (180.0 / M_PI); rgflVecOut[1] = acos(vecTemp.x) * (180.0f / M_PI_F);
if (vecTemp.y < 0) if (vecTemp.y < 0)
rgflVecOut[1] = -rgflVecOut[1]; rgflVecOut[1] = -rgflVecOut[1];
rgflVecOut[2] = 0; //for now rgflVecOut[2] = 0; //for now
@ -406,7 +406,7 @@ Vector UTIL_AxisRotationToAngles( const Vector &vecAxis, float flDegs )
Vector UTIL_AxisRotationToVec( const Vector &vecAxis, float flDegs ) Vector UTIL_AxisRotationToVec( const Vector &vecAxis, float flDegs )
{ {
float rgflVecOut[3]; float rgflVecOut[3];
float flRads = flDegs * (M_PI / 180.0); float flRads = flDegs * (M_PI_F / 180.0f);
float c = cos(flRads); float c = cos(flRads);
float s = sin(flRads); float s = sin(flRads);
float v = vecAxis.x * (1-c); float v = vecAxis.x * (1-c);
@ -1679,7 +1679,7 @@ BOOL UTIL_IsFacing( entvars_t *pevTest, const Vector &reference )
angle.x = 0; angle.x = 0;
UTIL_MakeVectorsPrivate( angle, forward, NULL, NULL ); UTIL_MakeVectorsPrivate( angle, forward, NULL, NULL );
// He's facing me, he meant it // 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; return TRUE;
} }

Loading…
Cancel
Save