Fix a crash when adding a symmetric constraint on two points.

The crash was introduced in e2e91672; I have not noticed that some
of the code relies on past-the-size entities in GW.GS being empty.
This commit is contained in:
whitequark 2016-08-28 16:50:36 +00:00
parent c4ad073d1b
commit a2c97fcd46

View File

@ -370,7 +370,8 @@ void Constraint::MenuConstrain(int id) {
((gs.workplanes == 1 && gs.n == 3) ||
(gs.n == 2)))
{
c.entityA = gs.entity[0];
if(gs.entities > 0)
c.entityA = gs.entity[0];
c.ptA = gs.point[0];
c.ptB = gs.point[1];
} else if(gs.lineSegments == 1 &&