From ca5ac723645e991ef3a2a8ced189f28dfb027b13 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 18 Jan 2016 21:17:11 +0100 Subject: [PATCH] - added missing FIXED2DBL call in A_Face. --- src/p_enemy.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 14d4176794..ef2e15955f 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2777,9 +2777,7 @@ void A_Face (AActor *self, AActor *other, angle_t max_turn, angle_t max_pitch, a // disabled and is so by default. if (max_pitch <= ANGLE_180) { - // [DH] Don't need to do proper fixed->double conversion, since the - // result is only used in a ratio. - fixedvec2 dist = self->Vec2To(other); + TVector2 dist = self->Vec2To(other); // Positioning ala missile spawning, 32 units above foot level fixed_t source_z = self->Z() + 32*FRACUNIT + self->GetBobOffset(); @@ -2803,8 +2801,8 @@ void A_Face (AActor *self, AActor *other, angle_t max_turn, angle_t max_pitch, a if (!(flags & FAF_NODISTFACTOR)) target_z += pitch_offset; - double dist_z = target_z - source_z; - double ddist = sqrt(dist.x*dist.x + dist.y*dist.y + dist_z*dist_z); + double dist_z = FIXED2DBL(target_z - source_z); + double ddist = sqrt(dist.X*dist.X + dist.Y*dist.Y + dist_z*dist_z); int other_pitch = (int)rad2bam(asin(dist_z / ddist)); if (max_pitch != 0)