Fix Fixture:getShape() causing crashes with ChainShapes (resolves issue #1392), removed dead code that's no longer valid

This commit is contained in:
Alex Szpakowski
2018-04-07 18:37:29 -03:00
parent bb228cab0c
commit b934f74795
2 changed files with 3 additions and 16 deletions
+2 -12
View File
@@ -36,8 +36,8 @@ namespace box2d
love::Type ChainShape::type("ChainShape", &Shape::type);
ChainShape::ChainShape(b2ChainShape *c, bool loop, bool own)
: Shape(c, own), loop(loop)
ChainShape::ChainShape(b2ChainShape *c, bool own)
: Shape(c, own)
{
}
@@ -47,11 +47,6 @@ ChainShape::~ChainShape()
void ChainShape::setNextVertex(float x, float y)
{
if (loop)
{
throw love::Exception("Physics error: Can't call setNextVertex on a loop ChainShape");
return;
}
b2Vec2 v(x, y);
b2ChainShape *c = (b2ChainShape *)shape;
c->SetNextVertex(Physics::scaleDown(v));
@@ -65,11 +60,6 @@ void ChainShape::setNextVertex()
void ChainShape::setPreviousVertex(float x, float y)
{
if (loop)
{
throw love::Exception("Physics error: Can't call setPreviousVertex on a loop ChainShape");
return;
}
b2Vec2 v(x, y);
b2ChainShape *c = (b2ChainShape *)shape;
c->SetPrevVertex(Physics::scaleDown(v));