From 531c6cc375cca5f804d8eb541e941035d6f67467 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 6 Oct 2019 06:51:04 +0300 Subject: [PATCH] engine: server: explicitly cast literals to floats --- engine/server/sv_main.c | 1 - engine/server/sv_move.c | 4 ++-- engine/server/sv_phys.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index c0f7d68e..57a20617 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -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 ) { diff --git a/engine/server/sv_move.c b/engine/server/sv_move.c index 533c52e5..826cdf22 100644 --- a/engine/server/sv_move.c +++ b/engine/server/sv_move.c @@ -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 SV_FlyDirection( ent, vecDist ); } } -} \ No newline at end of file +} diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 239179b3..73aa602b 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -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 ) { // 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;