diff --git a/src/api/l_physics_collider.c b/src/api/l_physics_collider.c index aaa8b433..37af9ef8 100644 --- a/src/api/l_physics_collider.c +++ b/src/api/l_physics_collider.c @@ -27,22 +27,14 @@ static int l_lovrColliderGetWorld(lua_State* L) { static int l_lovrColliderGetShape(lua_State* L) { Collider* collider = luax_checktype(L, 1, Collider); Shape* shape = lovrColliderGetShape(collider); - if (shape) { - luax_pushshape(L, shape); - } else { - lua_pushnil(L); - } + luax_pushshape(L, shape); return 1; } static int l_lovrColliderSetShape(lua_State* L) { Collider* collider = luax_checktype(L, 1, Collider); - if (lua_isnoneornil(L, 2)) { - lovrColliderSetShape(collider, NULL); - } else { - Shape* shape = luax_checkshape(L, 2); - lovrColliderSetShape(collider, shape); - } + Shape* shape = luax_checkshape(L, 2); + lovrColliderSetShape(collider, shape); return 0; } diff --git a/src/modules/physics/physics_jolt.c b/src/modules/physics/physics_jolt.c index a8507a13..facf904a 100644 --- a/src/modules/physics/physics_jolt.c +++ b/src/modules/physics/physics_jolt.c @@ -423,12 +423,6 @@ void lovrColliderSetShape(Collider* collider, Shape* shape) { } void lovrColliderGetShapeOffset(Collider* collider, float* position, float* orientation) { - if (!collider->shape) { - vec3_set(position, 0.f, 0.f, 0.f); - quat_identity(orientation); - return; - } - const JPH_Shape* shape = JPH_BodyInterface_GetShape(collider->world->body_interface, collider->id); if (JPH_Shape_GetSubType(shape) == JPH_ShapeSubType_RotatedTranslated) { @@ -445,10 +439,6 @@ void lovrColliderGetShapeOffset(Collider* collider, float* position, float* orie } void lovrColliderSetShapeOffset(Collider* collider, float* position, float* orientation) { - if (!collider->shape) { - return; - } - const JPH_Shape* shape = JPH_BodyInterface_GetShape(collider->world->body_interface, collider->id); if (JPH_Shape_GetSubType(shape) == JPH_ShapeSubType_RotatedTranslated) {