Update userdata stuff to how new box2d wants it

This commit is contained in:
Garrett Brown
2020-10-17 22:30:01 -04:00
parent 77f238767f
commit 1b74b34cce
7 changed files with 7 additions and 43 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ Fixture::Fixture(Body *body, Shape *shape, float density)
udata->ref = nullptr;
b2FixtureDef def;
def.shape = shape->shape;
def.userData = udata;
def.userData.pointer = (uintptr_t)udata;
def.density = density;
fixture = body->body->CreateFixture(&def);
this->retain();
@@ -262,7 +262,7 @@ int Fixture::setUserData(lua_State *L)
if (udata == nullptr)
{
udata = new fixtureudata();
fixture->SetUserData(udata);
fixture->GetUserData().pointer = (uintptr_t)udata;
}
if(!udata->ref)