mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Import box2d-contacts branch from love-experiments
Fix issues with Contact lifetime, based on the work of Matteo "teomat" Goggi
This commit is contained in:
@@ -39,7 +39,21 @@ Contact::Contact(b2Contact *contact)
|
||||
|
||||
Contact::~Contact()
|
||||
{
|
||||
Memoizer::remove(contact);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void Contact::invalidate()
|
||||
{
|
||||
if (contact != NULL)
|
||||
{
|
||||
Memoizer::remove(contact);
|
||||
contact = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool Contact::isValid()
|
||||
{
|
||||
return contact != NULL ? true : false;
|
||||
}
|
||||
|
||||
int Contact::getPositions(lua_State *L)
|
||||
|
||||
Reference in New Issue
Block a user