diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 89ca3a799..b88e3e2a0 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1320,19 +1320,15 @@ void P_LoadSegs (MapData * map) if (delta_angle >= 1.) { double dis = (li->v2->fPos() - li->v1->fPos()).Length(); - DVector2 delta = seg_angle.ToVector(); + DVector2 delta = seg_angle.ToVector(dis); if ((vnum2 > vnum1) && (vertchanged[vnum2] == 0)) { - li->v2->set( - li->v1->fX() + dis * delta.X, - li->v1->fY() + dis * delta.Y); + li->v2->set(li->v1->fPos() + delta); vertchanged[vnum2] = 1; // this was changed } else if (vertchanged[vnum1] == 0) { - li->v1->set( - li->v2->fX() - dis * delta.X, - li->v2->fY() - dis * delta.Y); + li->v1->set(li->v2->fPos() - delta); vertchanged[vnum1] = 1; // this was changed } } diff --git a/src/r_defs.h b/src/r_defs.h index 2719ff7ee..6b2aa79a3 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -118,6 +118,11 @@ public: p.Y = y; } + void set(const DVector2 &pos) + { + p = pos; + } + double fX() const { return p.X;