]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
remove stupid int casts of pitch/yaw in beam code, yet another instance
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 May 2007 17:15:21 +0000 (17:15 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 May 2007 17:15:21 +0000 (17:15 +0000)
of this legacy from quake that I hadn't killed yet

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7350 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c

index 8cba25a7d602e8be5cad11550323dba3af94d38a..12704f50374e4f0020e6bd3649371f355c532c39 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -1554,7 +1554,7 @@ void CL_RelinkBeams(void)
        vec3_t dist, org, start, end;
        float d;
        entity_t *ent;
        vec3_t dist, org, start, end;
        float d;
        entity_t *ent;
-       float yaw, pitch;
+       double yaw, pitch;
        float forward;
        matrix4x4_t tempmatrix;
 
        float forward;
        matrix4x4_t tempmatrix;
 
@@ -1597,12 +1597,12 @@ void CL_RelinkBeams(void)
                }
                else
                {
                }
                else
                {
-                       yaw = (int) (atan2(dist[1], dist[0]) * 180 / M_PI);
+                       yaw = atan2(dist[1], dist[0]) * 180 / M_PI;
                        if (yaw < 0)
                                yaw += 360;
 
                        forward = sqrt (dist[0]*dist[0] + dist[1]*dist[1]);
                        if (yaw < 0)
                                yaw += 360;
 
                        forward = sqrt (dist[0]*dist[0] + dist[1]*dist[1]);
-                       pitch = (int) (atan2(dist[2], forward) * 180 / M_PI);
+                       pitch = atan2(dist[2], forward) * 180 / M_PI;
                        if (pitch < 0)
                                pitch += 360;
                }
                        if (pitch < 0)
                                pitch += 360;
                }