mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Replaced the EXCEPT_GUARD macro for converting love exceptions into Lua errors with the new luax_catchexcept function, which takes lambda function arguments.
This commit is contained in:
@@ -246,7 +246,7 @@ int Physics::getDistance(lua_State *L)
|
||||
b2SimplexCache c;
|
||||
c.count = 0;
|
||||
|
||||
EXCEPT_GUARD(
|
||||
luax_catchexcept(L, [&]() {
|
||||
pA.Set(fixtureA->fixture->GetShape(), 0);
|
||||
pB.Set(fixtureB->fixture->GetShape(), 0);
|
||||
i.proxyA = pA;
|
||||
@@ -255,7 +255,7 @@ int Physics::getDistance(lua_State *L)
|
||||
i.transformB = fixtureB->fixture->GetBody()->GetTransform();
|
||||
i.useRadii = true;
|
||||
b2Distance(&o, &c, &i);
|
||||
)
|
||||
});
|
||||
|
||||
lua_pushnumber(L, Physics::scaleUp(o.distance));
|
||||
lua_pushnumber(L, Physics::scaleUp(o.pointA.x));
|
||||
|
||||
Reference in New Issue
Block a user