mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Add basic lua 5.3 support
This commit is contained in:
@@ -55,7 +55,7 @@ int w_ChainShape_setPreviousVertex(lua_State *L)
|
||||
int w_ChainShape_getChildEdge(lua_State *L)
|
||||
{
|
||||
ChainShape *c = luax_checkchainshape(L, 1);
|
||||
int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index
|
||||
int index = (int) luaL_checknumber(L, 2) - 1; // Convert from 1-based index
|
||||
EdgeShape *e = 0;
|
||||
luax_catchexcept(L, [&](){ e = c->getChildEdge(index); });
|
||||
luax_pushtype(L, PHYSICS_EDGE_SHAPE_ID, e);
|
||||
@@ -74,7 +74,7 @@ int w_ChainShape_getVertexCount(lua_State *L)
|
||||
int w_ChainShape_getPoint(lua_State *L)
|
||||
{
|
||||
ChainShape *c = luax_checkchainshape(L, 1);
|
||||
int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index
|
||||
int index = (int) luaL_checknumber(L, 2) - 1; // Convert from 1-based index
|
||||
b2Vec2 v;
|
||||
luax_catchexcept(L, [&](){ v = c->getPoint(index); });
|
||||
lua_pushnumber(L, v.x);
|
||||
|
||||
Reference in New Issue
Block a user