From 2ffa810c06484f3f83c7cea77181e719e22ccbad Mon Sep 17 00:00:00 2001 From: bjorn Date: Fri, 10 May 2024 15:25:54 -0700 Subject: [PATCH] Fix Collider/Shape/Joint:setUserData with zero args; --- src/api/l_physics_collider.c | 1 + src/api/l_physics_joints.c | 1 + src/api/l_physics_shapes.c | 1 + 3 files changed, 3 insertions(+) diff --git a/src/api/l_physics_collider.c b/src/api/l_physics_collider.c index fd2845018..034aff5cb 100644 --- a/src/api/l_physics_collider.c +++ b/src/api/l_physics_collider.c @@ -78,6 +78,7 @@ static int l_lovrColliderGetUserData(lua_State* L) { static int l_lovrColliderSetUserData(lua_State* L) { luax_checktype(L, 1, Collider); + lua_settop(L, 2); luax_pushstash(L, "lovr.collider.userdata"); lua_pushvalue(L, 1); lua_pushvalue(L, 2); diff --git a/src/api/l_physics_joints.c b/src/api/l_physics_joints.c index 3bd164ad7..28c93ddc8 100644 --- a/src/api/l_physics_joints.c +++ b/src/api/l_physics_joints.c @@ -78,6 +78,7 @@ static int l_lovrJointGetUserData(lua_State* L) { static int l_lovrJointSetUserData(lua_State* L) { luax_checkjoint(L, 1); + lua_settop(L, 2); luax_pushstash(L, "lovr.joint.userdata"); lua_pushvalue(L, 1); lua_pushvalue(L, 2); diff --git a/src/api/l_physics_shapes.c b/src/api/l_physics_shapes.c index 77b0cff67..3ba5a04e3 100644 --- a/src/api/l_physics_shapes.c +++ b/src/api/l_physics_shapes.c @@ -244,6 +244,7 @@ static int l_lovrShapeGetUserData(lua_State* L) { static int l_lovrShapeSetUserData(lua_State* L) { luax_checkshape(L, 1); + lua_settop(L, 2); luax_pushstash(L, "lovr.shape.userdata"); lua_pushvalue(L, 1); lua_pushvalue(L, 2);