summaryrefslogtreecommitdiff
path: root/src/ode/body.c
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-03-22 23:06:26 -0500
committersanine <sanine.not@pm.me>2023-03-22 23:06:26 -0500
commitdc8f29206201fcc977443ce9c6138c2f3129c1c8 (patch)
treed2acf572e965f3fdabf4fdb02ee0779ddacfb846 /src/ode/body.c
parent78eb15d59190c079b1edb405eeae6696724f1b2e (diff)
re-implement bouncing ball
Diffstat (limited to 'src/ode/body.c')
-rw-r--r--src/ode/body.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ode/body.c b/src/ode/body.c
index f543b34..1284bb0 100644
--- a/src/ode/body.c
+++ b/src/ode/body.c
@@ -19,9 +19,11 @@ void ode_push_body(lua_State *L, dBodyID bb)
{
struct body_t *b = lua_newuserdata(L, sizeof(struct body_t));
b->id = bb;
- b->data.L = L;
- b->data.callback_ref = LUA_NOREF;
- dBodySetData(b->id, &(b->data));
+ if (bb != 0) {
+ b->data.L = L;
+ b->data.callback_ref = LUA_NOREF;
+ dBodySetData(b->id, &(b->data));
+ }
luaL_getmetatable(L, ode_body_tname);
lua_setmetatable(L, -2);
}
@@ -140,7 +142,8 @@ int dBodyGetQuaternion_bind(lua_State *L)
lua_pushnumber(L, bind_result[0]);
lua_pushnumber(L, bind_result[1]);
lua_pushnumber(L, bind_result[2]);
- return 3;
+ lua_pushnumber(L, bind_result[3]);
+ return 4;
}