mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 19:29:52 +02:00
fix use of deprecated luaL_getn function
This commit is contained in:
@@ -25,8 +25,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LUA_VERSION_NUM >= 502
|
#if LUA_VERSION_NUM >= 502
|
||||||
#define luaL_getn(L,i) lua_rawlen(L, (i))
|
|
||||||
|
|
||||||
LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
|
LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
|
||||||
#else
|
#else
|
||||||
LUALIB_API void (lua_pushglobaltable) (lua_State *L);
|
LUALIB_API void (lua_pushglobaltable) (lua_State *L);
|
||||||
|
@@ -2230,7 +2230,7 @@ int LuaScriptInterface::renderer_renderModes(lua_State * l)
|
|||||||
{
|
{
|
||||||
int size = 0;
|
int size = 0;
|
||||||
luaL_checktype(l, 1, LUA_TTABLE);
|
luaL_checktype(l, 1, LUA_TTABLE);
|
||||||
size = luaL_getn(l, 1);
|
size = lua_objlen(l, 1);
|
||||||
|
|
||||||
std::vector<unsigned int> renderModes;
|
std::vector<unsigned int> renderModes;
|
||||||
for(int i = 1; i <= size; i++)
|
for(int i = 1; i <= size; i++)
|
||||||
@@ -2263,7 +2263,7 @@ int LuaScriptInterface::renderer_displayModes(lua_State * l)
|
|||||||
{
|
{
|
||||||
int size = 0;
|
int size = 0;
|
||||||
luaL_checktype(l, 1, LUA_TTABLE);
|
luaL_checktype(l, 1, LUA_TTABLE);
|
||||||
size = luaL_getn(l, 1);
|
size = lua_objlen(l, 1);
|
||||||
|
|
||||||
std::vector<unsigned int> displayModes;
|
std::vector<unsigned int> displayModes;
|
||||||
for(int i = 1; i <= size; i++)
|
for(int i = 1; i <= size; i++)
|
||||||
|
Reference in New Issue
Block a user