diff --git a/src/objects/part.cpp b/src/objects/part.cpp index 54e99c2..92af98a 100644 --- a/src/objects/part.cpp +++ b/src/objects/part.cpp @@ -24,8 +24,8 @@ Part::Part(PartConstructParams params): Instance(&TYPE_), position(params.positi // This feels wrong. Get access to PhysicsWorld somehow else? Part will need access to this often though, most likely... extern rp::PhysicsWorld* world; Part::~Part() { - world->destroyRigidBody(rigidBody); - Instance::~Instance(); + if (this->rigidBody) + world->destroyRigidBody(rigidBody); }