From 43d93a19a0251d6bebb45d916bab883dd0c6a60b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 11 May 2016 11:35:56 +0200 Subject: [PATCH] - fixed: P_AlignFlat had the 'dist' value negated. Also simplified the code a bit. --- src/p_sectors.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index 9199f0812..ed8087543 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -1126,11 +1126,9 @@ bool P_AlignFlat (int linenum, int side, int fc) if (!sec) return false; - DVector2 pos = line->v1->fPos(); - DVector2 pos2 = line->v2->fPos(); - DAngle angle = (pos2 - pos).Angle(); + DAngle angle = line->Delta().Angle(); DAngle norm = angle - 90; - double dist = norm.Cos() * pos.X + norm.Sin() * pos.Y; + double dist = -(norm.Cos() * line->v1->fX() + norm.Sin() * line->v1->fY()); if (side) {