mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-11 15:38:12 +00:00
Merge branch 'sohl1.2' into aomdc
This commit is contained in:
commit
cdd2c2373c
@ -156,7 +156,7 @@ void CHud :: MsgFunc_KeyedDLight( const char *pszName, int iSize, void *pbuf )
|
||||
else
|
||||
{
|
||||
// never die
|
||||
dl->die = gEngfuncs.GetClientTime() + 1E6;
|
||||
dl->die = gEngfuncs.GetClientTime() + (float)1E6;
|
||||
|
||||
dl->origin[0] = READ_COORD();
|
||||
dl->origin[1] = READ_COORD();
|
||||
|
@ -105,13 +105,13 @@ void CShinySurface::Draw(const vec3_t &org)
|
||||
// gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, m_fAlpha );
|
||||
gEngfuncs.pTriAPI->Begin( TRI_QUADS );
|
||||
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->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->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->Vertex3f ( m_fMaxX, m_fMinY, m_fZ+0.02 );
|
||||
gEngfuncs.pTriAPI->Vertex3f ( m_fMaxX, m_fMinY, m_fZ+0.02f );
|
||||
gEngfuncs.pTriAPI->End();
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ void CFuncShine :: DesiredAction( void )
|
||||
if (pev->message && pev->renderamt)
|
||||
{
|
||||
// ALERT(at_console, "Prepare think\n");
|
||||
pev->nextthink = gpGlobals->time + 1.5;
|
||||
pev->nextthink = gpGlobals->time + 1.5f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ void CEnvState::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
|
||||
m_iState = STATE_TURN_OFF;
|
||||
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 );
|
||||
}
|
||||
|
@ -599,7 +599,7 @@ void CBaseEntity :: SetEternalThink( void )
|
||||
// record m_fPevNextThink as well, because we want to be able to
|
||||
// tell when the bloody engine CHANGES IT!
|
||||
// pev->nextthink = 1E9;
|
||||
pev->nextthink = pev->ltime + 1E6;
|
||||
pev->nextthink = pev->ltime + (float)1E6;
|
||||
m_fPevNextThink = pev->nextthink;
|
||||
}
|
||||
|
||||
|
@ -549,7 +549,7 @@ void ClientCommand( edict_t *pEntity )
|
||||
}
|
||||
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
|
||||
GetClassPtr((CBasePlayer *)pev)->GiveNamedItem( STRING(iszItem) );
|
||||
|
@ -781,7 +781,7 @@ CBaseEntity* CBeam::GetTripEntity( TraceResult *ptr )
|
||||
{
|
||||
CBaseEntity* pTrip;
|
||||
|
||||
if (ptr->flFraction == 1.0 || ptr->pHit == NULL)
|
||||
if (ptr->flFraction == 1.0f || ptr->pHit == NULL)
|
||||
return NULL;
|
||||
|
||||
pTrip = CBaseEntity::Instance(ptr->pHit);
|
||||
@ -2163,7 +2163,7 @@ void CShot :: Touch ( CBaseEntity *pOther )
|
||||
return;
|
||||
// don't fire too often in collisions!
|
||||
// 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)
|
||||
FireTargets( STRING(pev->netname), this, this, USE_TOGGLE, 0 );
|
||||
@ -2363,7 +2363,7 @@ CBaseEntity *CEnvShooter :: CreateGib ( Vector vecPos, Vector vecVel )
|
||||
if (pShot->pev->framerate)
|
||||
{
|
||||
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)
|
||||
{
|
||||
@ -3554,12 +3554,12 @@ void CEnvRain::Think( void )
|
||||
break;
|
||||
case EXTENT_ARCING:
|
||||
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;
|
||||
break;
|
||||
case EXTENT_ARCING_REVERSE:
|
||||
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;
|
||||
break;
|
||||
}
|
||||
@ -3640,7 +3640,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());
|
||||
UTIL_TraceLine( pev->origin, pev->origin + vecDest, ignore_monsters, NULL, &tr);
|
||||
if (tr.flFraction != 1.0)
|
||||
if (tr.flFraction != 1.0f)
|
||||
{
|
||||
// we hit something.
|
||||
iDrawn++;
|
||||
@ -4083,7 +4083,7 @@ void CEnvDecal::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use
|
||||
|
||||
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
|
||||
|
||||
entityIndex = (short)ENTINDEX(trace.pHit);
|
||||
@ -4505,7 +4505,7 @@ public:
|
||||
void CEnvSky :: Activate ( void )
|
||||
{
|
||||
pev->effects |= EF_NODRAW;
|
||||
pev->nextthink = gpGlobals->time + 1.0;
|
||||
pev->nextthink = gpGlobals->time + 1.0f;
|
||||
}
|
||||
|
||||
extern int gmsgSetSky;
|
||||
|
@ -1136,7 +1136,7 @@ void CPushable::Move( CBaseEntity *pOther, int push )
|
||||
factor = 0.25f;
|
||||
|
||||
if (!push)
|
||||
factor = factor*0.5;
|
||||
factor *= 0.5f;
|
||||
|
||||
pev->velocity.x += pevToucher->velocity.x * factor;
|
||||
pev->velocity.y += pevToucher->velocity.y * factor;
|
||||
|
@ -1056,7 +1056,7 @@ void CFuncTank::TrackTarget( void )
|
||||
UTIL_SetAvelocity(this, setAVel);
|
||||
|
||||
// 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();
|
||||
|
||||
// firing in tanksequences:
|
||||
@ -1070,7 +1070,7 @@ void CFuncTank::TrackTarget( void )
|
||||
UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL );
|
||||
|
||||
// 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 );
|
||||
|
||||
@ -1093,7 +1093,7 @@ void CFuncTank::TrackTarget( void )
|
||||
UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL );
|
||||
|
||||
// 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 );
|
||||
|
||||
|
@ -1089,7 +1089,7 @@ void CGargantua::StartTask( Task_t *pTask )
|
||||
if ( m_pCine->IsAction() && m_pCine->m_fAction == 3)
|
||||
{
|
||||
FlameCreate();
|
||||
m_flWaitFinished = gpGlobals->time + 4.5;
|
||||
m_flWaitFinished = gpGlobals->time + 4.5f;
|
||||
m_flameTime = gpGlobals->time + 6;
|
||||
m_flameX = 0;
|
||||
m_flameY = 0;
|
||||
|
@ -142,7 +142,7 @@ void CGenericMonster::Spawn()
|
||||
if (pev->targetname)
|
||||
ALERT(at_error, "No model specified for monster_generic \"%s\"\n", STRING(pev->targetname));
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -296,7 +296,7 @@ void CHAssassin::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
{ // just jump, it doesn't matter where to.
|
||||
//ALERT(at_console,"Nonprecise jump for assassin %s\n",STRING(pev->targetname));
|
||||
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;
|
||||
UTIL_MakeVectors(pev->angles);
|
||||
Vector vecDest = pev->origin + (gpGlobals->v_forward * 32);
|
||||
|
@ -484,7 +484,7 @@ BOOL CISlave :: CheckRangeAttack2 ( float flDot, float flDist )
|
||||
TraceResult 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)
|
||||
{
|
||||
|
@ -414,7 +414,7 @@ void COsprey::FlyThink( void )
|
||||
do{
|
||||
m_pGoalEnt = UTIL_FindEntityByTargetname( NULL, STRING( m_pGoalEnt->pev->target ) );
|
||||
loopbreaker--; //LRC
|
||||
} while ( m_pGoalEnt && m_pGoalEnt->pev->speed < 400 && !HasDead() && loopbreaker > 0);
|
||||
} while ( m_pGoalEnt && m_pGoalEnt->pev->speed < 400 && !HasDead() && loopbreaker > 0 );
|
||||
}
|
||||
UpdateGoal();
|
||||
}
|
||||
|
@ -971,11 +971,11 @@ void CFuncTrain::Next( void )
|
||||
{
|
||||
case PATHSPEED_SET:
|
||||
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;
|
||||
case PATHSPEED_ACCEL:
|
||||
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;
|
||||
case PATHSPEED_TIME:
|
||||
float distance;
|
||||
@ -985,7 +985,7 @@ void CFuncTrain::Next( void )
|
||||
distance = (pev->origin - (pTarg->pev->origin - (pev->mins + pev->maxs) * 0.5f)).Length();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -1020,7 +1020,7 @@ void CFuncTrain::Next( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pev->spawnflags & SF_TRAIN_SETORIGIN)
|
||||
if (pev->spawnflags & SF_TRAIN_SETORIGIN)
|
||||
UTIL_AssignOrigin(this, pTarg->pev->origin );
|
||||
else
|
||||
UTIL_AssignOrigin(this, pTarg->pev->origin - (pev->mins + pev->maxs) * 0.5f );
|
||||
@ -1125,11 +1125,11 @@ void CFuncTrain :: PostSpawn( void )
|
||||
}
|
||||
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)
|
||||
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
|
||||
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 )
|
||||
@ -1149,9 +1149,9 @@ void CFuncTrain :: PostSpawn( void )
|
||||
|
||||
void CFuncTrain :: ThinkDoNext( void )
|
||||
{
|
||||
SetNextThink( 0.1 );
|
||||
SetNextThink( 0.1f );
|
||||
// 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 );
|
||||
}
|
||||
|
||||
@ -1364,8 +1364,8 @@ void CFuncTrackTrain :: Spawn( void )
|
||||
|
||||
void CFuncTrackTrain :: Precache( void )
|
||||
{
|
||||
if (m_flVolume == 0.0)
|
||||
m_flVolume = 1.0;
|
||||
if (m_flVolume == 0.0f)
|
||||
m_flVolume = 1.0f;
|
||||
|
||||
switch (m_sounds)
|
||||
{
|
||||
@ -1554,7 +1554,7 @@ void CFuncTrackTrain::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY
|
||||
}
|
||||
|
||||
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
|
||||
if (pev->spawnflags & SF_TRACKTRAIN_NOCONTROL)
|
||||
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;
|
||||
case PATHSPEED_SET_MASTER:
|
||||
m_speed = pFire->pev->speed;
|
||||
pev->impulse = 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;
|
||||
case PATHSPEED_ACCEL:
|
||||
m_speed += pFire->pev->speed;
|
||||
pev->impulse = 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;
|
||||
case PATHSPEED_TIME:
|
||||
float distance = (pev->origin - pDest->pev->origin).Length();
|
||||
@ -1840,7 +1840,7 @@ void CFuncTrackTrain :: DesiredAction( void ) // Next( void )
|
||||
m_speed = distance / pFire->pev->speed;
|
||||
pev->impulse = 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;
|
||||
}
|
||||
}
|
||||
|
@ -463,14 +463,14 @@ void CCineMonster :: InitIdleThink( void )
|
||||
if ((m_hTargetEnt = FindEntity(STRING(m_iszEntity), NULL)) != NULL)
|
||||
{
|
||||
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 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
CancelScript( );
|
||||
ALERT( at_aiconsole, "script \"%s\" can't find monster \"%s\"\n", STRING( pev->targetname ), STRING( m_iszEntity ) );
|
||||
SetNextThink( 1.0 );
|
||||
SetNextThink( 1.0f );
|
||||
}
|
||||
}
|
||||
|
||||
@ -704,7 +704,7 @@ void CCineMonster::DelayStart( int state )
|
||||
{
|
||||
pTarget->m_iState = STATE_ON; //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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ void CAmbientGeneric::Spawn( void )
|
||||
if( FStringNull( pev->message ) || szSoundFile[0] == '\0' )
|
||||
{
|
||||
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 );
|
||||
SetThink( &CAmbientGeneric::SUB_Remove );
|
||||
return;
|
||||
@ -1919,7 +1919,7 @@ void CSpeaker::Spawn( void )
|
||||
|
||||
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 );
|
||||
SetThink( &CSpeaker::SUB_Remove );
|
||||
return;
|
||||
|
@ -433,7 +433,7 @@ void CTriggerRotTest::Think( void )
|
||||
// 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);
|
||||
}
|
||||
pev->armorvalue += pev->armortype * 0.1;
|
||||
pev->armorvalue += pev->armortype * 0.1f;
|
||||
SetNextThink( 0.1 );
|
||||
}
|
||||
|
||||
@ -2334,7 +2334,7 @@ void CTriggerHurt :: HurtTouch ( CBaseEntity *pOther )
|
||||
// while touching the trigger. Player continues taking damage for a while after
|
||||
// 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.
|
||||
@ -2361,7 +2361,7 @@ void CTriggerHurt :: HurtTouch ( CBaseEntity *pOther )
|
||||
pev->pain_finished = gpGlobals->time;
|
||||
|
||||
// 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
|
||||
|
||||
|
||||
|
||||
@ -2407,8 +2407,8 @@ void CTriggerHurt :: RadiationThink( void )
|
||||
origin = pev->origin;
|
||||
view_ofs = pev->view_ofs;
|
||||
|
||||
pev->origin = (pev->absmin + pev->absmax) * 0.5;
|
||||
pev->view_ofs = pev->view_ofs * 0.0;
|
||||
pev->origin = (pev->absmin + pev->absmax) * 0.5f;
|
||||
pev->view_ofs = pev->view_ofs * 0.0f;
|
||||
|
||||
pentPlayer = FIND_CLIENT_IN_PVS(edict());
|
||||
|
||||
@ -2426,9 +2426,9 @@ void CTriggerHurt :: RadiationThink( void )
|
||||
|
||||
// get range to player;
|
||||
|
||||
vecSpot1 = (pev->absmin + pev->absmax) * 0.5;
|
||||
vecSpot2 = (pevTarget->absmin + pevTarget->absmax) * 0.5;
|
||||
|
||||
vecSpot1 = (pev->absmin + pev->absmax) * 0.5f;
|
||||
vecSpot2 = (pevTarget->absmin + pevTarget->absmax) * 0.5f;
|
||||
|
||||
vecRange = vecSpot1 - vecSpot2;
|
||||
flRange = vecRange.Length();
|
||||
|
||||
@ -2440,7 +2440,7 @@ void CTriggerHurt :: RadiationThink( void )
|
||||
pPlayer->m_flgeigerRange = flRange;
|
||||
}
|
||||
|
||||
SetNextThink( 0.25 );
|
||||
SetNextThink( 0.25f );
|
||||
}
|
||||
|
||||
//=====================================
|
||||
@ -2493,7 +2493,7 @@ void CTriggerHevCharge :: ChargeTouch ( CBaseEntity *pOther )
|
||||
//FIXME: add in the multiplayer fix, from trigger_hurt?
|
||||
if ( pev->dmgtime > gpGlobals->time )
|
||||
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;
|
||||
if (iNewArmor > MAX_NORMAL_BATTERY) iNewArmor = MAX_NORMAL_BATTERY;
|
||||
@ -2536,7 +2536,7 @@ void CTriggerHevCharge :: AnnounceThink ( )
|
||||
|
||||
// Suit reports new power level
|
||||
// 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);
|
||||
if (pct > 0)
|
||||
pct--;
|
||||
@ -3894,7 +3894,7 @@ void CTriggerOnSight :: Spawn( void )
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -4030,7 +4030,7 @@ BOOL CTriggerOnSight :: CanSee(CBaseEntity *pLooker, CBaseEntity *pSeen)
|
||||
UTIL_TraceLine( pLooker->EyePosition(), pSeen->pev->origin, ignore_monsters, ignore_glass, pLooker->edict(), &tr );
|
||||
else
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ void CTripmineGrenade::PowerupThink( void )
|
||||
STOP_SOUND( ENT( pev ), CHAN_BODY, "weapons/mine_charge.wav" );
|
||||
SetThink( &CTripmineGrenade::SUB_Remove );
|
||||
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();
|
||||
return;
|
||||
}
|
||||
|
@ -420,8 +420,8 @@ Vector UTIL_AxisRotationToAngles( const Vector &vecAxis, float flDegs )
|
||||
Vector vecTemp = UTIL_AxisRotationToVec( vecAxis, flDegs );
|
||||
float rgflVecOut[3];
|
||||
//ugh, mathsy.
|
||||
rgflVecOut[0] = asin(vecTemp.z) * (-180.0 / M_PI);
|
||||
rgflVecOut[1] = acos(vecTemp.x) * (180.0 / M_PI);
|
||||
rgflVecOut[0] = asin(vecTemp.z) * (-180.0f / M_PI_F);
|
||||
rgflVecOut[1] = acos(vecTemp.x) * (180.0f / M_PI_F);
|
||||
if (vecTemp.y < 0)
|
||||
rgflVecOut[1] = -rgflVecOut[1];
|
||||
rgflVecOut[2] = 0; //for now
|
||||
@ -432,7 +432,7 @@ Vector UTIL_AxisRotationToAngles( const Vector &vecAxis, float flDegs )
|
||||
Vector UTIL_AxisRotationToVec( const Vector &vecAxis, float flDegs )
|
||||
{
|
||||
float rgflVecOut[3];
|
||||
float flRads = flDegs * (M_PI / 180.0);
|
||||
float flRads = flDegs * (M_PI_F / 180.0f);
|
||||
float c = cos(flRads);
|
||||
float s = sin(flRads);
|
||||
float v = vecAxis.x * (1-c);
|
||||
@ -1705,7 +1705,7 @@ BOOL UTIL_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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user