From de3a0c014205696978f86b15026982c400057962 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Sat, 7 Oct 2023 15:33:15 -0300 Subject: [PATCH] Improve error checking in love.physics.new*Shape --- src/modules/physics/box2d/wrap_Physics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/physics/box2d/wrap_Physics.cpp b/src/modules/physics/box2d/wrap_Physics.cpp index 917cdf812..d54a65f54 100644 --- a/src/modules/physics/box2d/wrap_Physics.cpp +++ b/src/modules/physics/box2d/wrap_Physics.cpp @@ -275,7 +275,7 @@ int w_newFixture(lua_State *L) static Body *luax_optbodyforshape(lua_State *L, int idx, const char *name) { - if (luax_istype(L, idx, Body::type)) + if (lua_isnoneornil(L, idx) || luax_istype(L, idx, Object::type)) return luax_checkbody(L, idx); luax_markdeprecated(L, 1, name, API_FUNCTION_VARIANT, DEPRECATED_REPLACED, "variant with Body parameter");