mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 01:41:23 +02:00
CLuaInstance: Script function 'checkVersion' terminated an error...
...occurs immediately the script
Complement to commit 00dff2c598
- Set Lua api version to 1.4
This commit is contained in:
@@ -2691,20 +2691,19 @@ int CLuaInstance::checkVersion(lua_State *L)
|
|||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int major=0, minor=0, ret=1;
|
int major=0, minor=0;
|
||||||
major = luaL_checkint(L, 2);
|
major = luaL_checkint(L, 2);
|
||||||
minor = luaL_checkint(L, 3);
|
minor = luaL_checkint(L, 3);
|
||||||
if ((major > LUA_API_VERSION_MAJOR) || ((major == LUA_API_VERSION_MAJOR) && (minor > LUA_API_VERSION_MINOR))) {
|
if ((major > LUA_API_VERSION_MAJOR) || ((major == LUA_API_VERSION_MAJOR) && (minor > LUA_API_VERSION_MINOR))) {
|
||||||
ret = 0;
|
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
snprintf(msg, sizeof(msg)-1, "%s (v%d.%d)\n%s v%d.%d",
|
snprintf(msg, sizeof(msg)-1, "%s (v%d.%d)\n%s v%d.%d",
|
||||||
g_Locale->getText(LOCALE_LUA_VERSIONSCHECK1),
|
g_Locale->getText(LOCALE_LUA_VERSIONSCHECK1),
|
||||||
LUA_API_VERSION_MAJOR, LUA_API_VERSION_MINOR,
|
LUA_API_VERSION_MAJOR, LUA_API_VERSION_MINOR,
|
||||||
g_Locale->getText(LOCALE_LUA_VERSIONSCHECK2),
|
g_Locale->getText(LOCALE_LUA_VERSIONSCHECK2),
|
||||||
major, minor);
|
major, minor);
|
||||||
DisplayErrorMessage(msg, "Lua Script Error:");
|
luaL_error(L, msg);
|
||||||
}
|
}
|
||||||
lua_pushinteger(L, ret);
|
lua_pushinteger(L, 1); /* for backward compatibility */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ extern "C" {
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define LUA_API_VERSION_MAJOR 1
|
#define LUA_API_VERSION_MAJOR 1
|
||||||
#define LUA_API_VERSION_MINOR 2
|
#define LUA_API_VERSION_MINOR 4
|
||||||
|
|
||||||
/* this is stored as userdata in the lua_State */
|
/* this is stored as userdata in the lua_State */
|
||||||
struct CLuaData
|
struct CLuaData
|
||||||
|
Reference in New Issue
Block a user