Browse Source

engine: server: explicitly cast literals to floats

pull/2/head
Alibek Omarov 5 years ago
parent
commit
531c6cc375
  1. 1
      engine/server/sv_main.c
  2. 4
      engine/server/sv_move.c
  3. 4
      engine/server/sv_phys.c

1
engine/server/sv_main.c

@ -581,7 +581,6 @@ qboolean SV_RunGameFrame( void ) @@ -581,7 +581,6 @@ qboolean SV_RunGameFrame( void )
{
double fps = (1.0 / (double)( sv_fps.value - 0.01 )); // FP issues
int numFrames = 0;
static double oldtime;
while( sv.time_residual >= fps )
{

4
engine/server/sv_move.c

@ -243,7 +243,7 @@ float SV_VecToYaw( const vec3_t src ) @@ -243,7 +243,7 @@ float SV_VecToYaw( const vec3_t src )
}
else
{
yaw = (int)( atan2( src[1], src[0] ) * 180.0f / M_PI );
yaw = (int)( atan2( src[1], src[0] ) * 180.0f / M_PI_F );
if( yaw < 0 ) yaw += 360.0f;
}
return yaw;
@ -570,4 +570,4 @@ void SV_MoveToOrigin( edict_t *ent, const vec3_t pflGoal, float dist, int iMoveT @@ -570,4 +570,4 @@ void SV_MoveToOrigin( edict_t *ent, const vec3_t pflGoal, float dist, int iMoveT
SV_FlyDirection( ent, vecDist );
}
}
}
}

4
engine/server/sv_phys.c

@ -373,7 +373,7 @@ float SV_RecursiveWaterLevel( vec3_t origin, float out, float in, int count ) @@ -373,7 +373,7 @@ float SV_RecursiveWaterLevel( vec3_t origin, float out, float in, int count )
vec3_t point;
float offset;
offset = ((out - in) * 0.5) + in;
offset = ((out - in) * 0.5f) + in;
if( ++count > 5 ) return offset;
VectorSet( point, origin[0], origin[1], origin[2] + offset );
@ -1375,7 +1375,7 @@ void SV_CheckWaterTransition( edict_t *ent ) @@ -1375,7 +1375,7 @@ void SV_CheckWaterTransition( edict_t *ent )
{
// just crossed into water
SV_StartSound( ent, CHAN_AUTO, "player/pl_wade1.wav", 1.0f, ATTN_NORM, 0, 100 );
ent->v.velocity[2] *= 0.5;
ent->v.velocity[2] *= 0.5f;
}
ent->v.watertype = cont;

Loading…
Cancel
Save