- fixed: P_AlignFlat had the 'dist' value negated. Also simplified the code a bit.

This commit is contained in:
Christoph Oelckers 2016-05-11 11:35:56 +02:00
parent f8c12f4533
commit 43d93a19a0

View file

@ -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)
{