mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Added Body/Contact/Fixture/Joint/World:isDestroyed (resolves issue #964.)
This commit is contained in:
@@ -564,6 +564,13 @@ int w_Body_destroy(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Body_isDestroyed(lua_State *L)
|
||||
{
|
||||
Body *b = luax_checktype<Body>(L, 1, "Body", PHYSICS_BODY_T);
|
||||
luax_pushboolean(L, b->body == nullptr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_Body_setUserData(lua_State *L)
|
||||
{
|
||||
Body *t = luax_checkbody(L, 1);
|
||||
@@ -635,6 +642,7 @@ static const luaL_Reg functions[] =
|
||||
{ "getJointList", w_Body_getJointList },
|
||||
{ "getContactList", w_Body_getContactList },
|
||||
{ "destroy", w_Body_destroy },
|
||||
{ "isDestroyed", w_Body_isDestroyed },
|
||||
{ "setUserData", w_Body_setUserData },
|
||||
{ "getUserData", w_Body_getUserData },
|
||||
{ 0, 0 }
|
||||
|
||||
Reference in New Issue
Block a user