Beispiel #1
0
/* function: api_intl_Q_ */
static int tolua_common_a_Q_00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
 !tolua_isstring(tolua_S,1,0,&tolua_err) || 
 !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
 goto tolua_lerror;
 else
#endif
 {
  lua_State* L =  tolua_S;
  const char* untranslated = ((const char*)  tolua_tostring(tolua_S,1,0));
 {
  const char* tolua_ret = (const char*)  api_intl_Q_(L,untranslated);
 tolua_pushstring(tolua_S,(const char*)tolua_ret);
 }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'Q_'.",&tolua_err);
 return 0;
#endif
}
Beispiel #2
0
/* function: api_utilities_log_base */
static int tolua_common_a_log_base00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
 !tolua_isnumber(tolua_S,1,0,&tolua_err) || 
 !tolua_isstring(tolua_S,2,0,&tolua_err) || 
 !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
 goto tolua_lerror;
 else
#endif
 {
  lua_State* L =  tolua_S;
  int log_level = ((int)  tolua_tonumber(tolua_S,1,0));
  const char* message = ((const char*)  tolua_tostring(tolua_S,2,0));
 {
  api_utilities_log_base(L,log_level,message);
 }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'base'.",&tolua_err);
 return 0;
#endif
}
Beispiel #3
0
static int tolua_CCGLProgram_CCGLProgram_addAttribute00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CCGLProgram",0,&tolua_err) ||
     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,4,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CCGLProgram* self = (CCGLProgram*)  tolua_tousertype(tolua_S,1,0);
  const char* attributeName = ((const char*)  tolua_tostring(tolua_S,2,0));
  unsigned int index = ((unsigned int)  tolua_tonumber(tolua_S,3,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'addAttribute'", NULL);
#endif
  {
   self->addAttribute(attributeName,index);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'addAttribute'.",&tolua_err);
 return 0;
#endif
}
Beispiel #4
0
/* method: setDataRootDirectory of class  Global */
static int tolua_LuaAPI_Global_setDataRootDirectory00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
 !tolua_isusertype(tolua_S,1,"Global",0,&tolua_err) || 
 !tolua_isstring(tolua_S,2,0,&tolua_err) || 
 !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
 goto tolua_lerror;
 else
#endif
 {
  Global* self = (Global*)  tolua_tousertype(tolua_S,1,0);
  const char* s = ((const char*)  tolua_tostring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setDataRootDirectory'",NULL);
#endif
 {
  self->setDataRootDirectory(s);
 }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'setDataRootDirectory'.",&tolua_err);
 return 0;
#endif
}
Beispiel #5
0
bool cPlugin_NewLua::OnChat(cPlayer * a_Player, AString & a_Message)
{
	cCSLock Lock(m_CriticalSection);
	const char * FnName = GetHookFnName(cPluginManager::HOOK_CHAT);
	ASSERT(FnName != NULL);
	if (!PushFunction(FnName))
	{
		return false;
	}

	tolua_pushusertype(m_LuaState, a_Player, "cPlayer");
	tolua_pushstring  (m_LuaState, a_Message.c_str());

	if (!CallFunction(2, 2, FnName))
	{
		return false;
	}

	bool bRetVal = (tolua_toboolean(m_LuaState, -2, 0) > 0);
	if (lua_isstring(m_LuaState, -1))
	{
		a_Message = tolua_tostring(m_LuaState, -1, "");
	}
	lua_pop(m_LuaState, 2);
	return bRetVal;
}
Beispiel #6
0
static int tolua_region_set_resource(lua_State * L)
{
  region *r = (region *) tolua_tousertype(L, 1, 0);
  const char *type = tolua_tostring(L, 2, 0);
  int result, value = (int)tolua_tonumber(L, 3, 0);
  critbit_tree * cb = special_resources();
  const void * matches;

  if (cb_find_prefix(cb, type, strlen(type)+1, &matches, 1, 0)) {
    cb_get_kv(matches, &result, sizeof(result));
    switch (result) {
    case 0:
    case 1:
    case 2:
      rsettrees(r, result, value);
      break;
    case 3:
      deathcounts(r, value - deathcount(r));
      break;
    case 4:
      chaoscounts(r, value - chaoscount(r));
      break;
    }
  } else {
    const resource_type *rtype = rt_find(type);
    if (rtype != NULL) {
      region_setresource(r, rtype, value);
    }
  }
  return 0;
}
Beispiel #7
0
static int tolua_CCGUI_CCValue_putString00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CCValue",0,&tolua_err) ||
     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CCValue* self = (CCValue*)  tolua_tousertype(tolua_S,1,0);
  const char* s = ((const char*)  tolua_tostring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'putString'", NULL);
#endif
  {
   self->putString(s);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'putString'.",&tolua_err);
 return 0;
#endif
}
static int tolua_Label_Label_create00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"Label",0,&tolua_err) ||
     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,4,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* label = ((const char*)  tolua_tostring(tolua_S,2,0));
  FontSize size = ((FontSize) (int)  tolua_tonumber(tolua_S,3,0));
  {
   Label* tolua_ret = (Label*)  Label::create(label,size);
    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Label");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'create'.",&tolua_err);
 return 0;
#endif
}
Beispiel #9
0
static int lua_ftk_popup_menu_create(lua_State* L)
{
	tolua_Error err = {0};
	FtkPopupMenu* retv;
	int x;
	int y;
	int w;
	int h;
	FtkBitmap* icon;
	const char* title;
	int param_ok = tolua_isnumber(L, 1, 0, &err) && tolua_isnumber(L, 2, 0, &err) && tolua_isnumber(L, 3, 0, &err) && tolua_isnumber(L, 4, 0, &err) && tolua_isusertype(L, 5, "FtkBitmap", 0, &err) && tolua_isstring(L, 6, 0, &err);

	return_val_if_fail(param_ok, 0);

	x = tolua_tonumber(L, 1, 0);
	y = tolua_tonumber(L, 2, 0);
	w = tolua_tonumber(L, 3, 0);
	h = tolua_tonumber(L, 4, 0);
	icon = tolua_tousertype(L, 5, 0);
	title = tolua_tostring(L, 6, 0);
	retv = ftk_popup_menu_create(x, y, w, h, icon, title);
	tolua_pushusertype(L, (FtkPopupMenu*)retv, "FtkPopupMenu");

	return 1;
}
static int tolua_PlayerData_PlayerData_setName00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"PlayerData",0,&tolua_err) ||
     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  PlayerData* self = (PlayerData*)  tolua_tousertype(tolua_S,1,0);
  char* _name = ((char*)  tolua_tostring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setName'", NULL);
#endif
  {
   self->setName(_name);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'setName'.",&tolua_err);
 return 0;
#endif
}
Beispiel #11
0
static int entity_GetProperty(lua_State *L)
{
    int n = lua_gettop(L);
    if (n != 2) {
        return luaL_error(L, "Entity::GetProperty(name) requires 1 parameter.");
    }
    Entity *entity = (Entity *)tolua_tousertype(L, 1, 0);
    const char *propName = tolua_tostring(L, 2, 0);
    const char *str;
    float f;
    bool b;
    Rect *r;
    Vector *v;
    if (entity->GetProperty(propName, str)) {
        lua_pushstring(L, str);
        return 1;
    } else if (entity->GetProperty(propName, f)) {
        lua_pushnumber(L, f);
        return 1;
    } else if (entity->GetProperty(propName, b)) {
        lua_pushboolean(L, b);
        return 1;
    } else if (entity->GetProperty(propName, r)) {
        tolua_pushusertype(L, (void*)r, "Rect");
        return 1;
    } else if (entity->GetProperty(propName, v)) {
        tolua_pushusertype(L, (void*)v, "Vector");
        return 1;
    } else {
        lua_pushnil(L);
        return 1;
    }
}
/* function: config_parse */
static int tolua_config_eressea_config_parse00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
 !tolua_isstring(tolua_S,1,0,&tolua_err) || 
 !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
 goto tolua_lerror;
 else
#endif
 {
  const char* json = ((const char*)  tolua_tostring(tolua_S,1,0));
 {
  int tolua_ret = (int)  config_parse(json);
 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
 }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'parse'.",&tolua_err);
 return 0;
#endif
}
Beispiel #13
0
/* function: eressea_write_game */
static int tolua_game_eressea_game_write00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
 !tolua_isstring(tolua_S,1,0,&tolua_err) || 
 !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
 goto tolua_lerror;
 else
#endif
 {
  const char* filename = ((const char*)  tolua_tostring(tolua_S,1,0));
 {
  int tolua_ret = (int)  eressea_write_game(filename);
 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
 }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'write'.",&tolua_err);
 return 0;
#endif
}
Beispiel #14
0
static int tolua_region_create(lua_State * L)
{
  int x = (int)tolua_tonumber(L, 1, 0);
  int y = (int)tolua_tonumber(L, 2, 0);
  const char *tname = tolua_tostring(L, 3, 0);
  if (tname) {
    plane *pl = findplane(x, y);
    const terrain_type *terrain = get_terrain(tname);
    region *r, *result;
    if (!terrain) {
      return 0;
    }

    assert(!pnormalize(&x, &y, pl));
    r = result = findregion(x, y);

    if (terrain == NULL && r != NULL && r->units != NULL) {
      /* TODO: error message */
      result = NULL;
    } else if (r == NULL) {
      result = new_region(x, y, pl, 0);
    }
    if (result) {
      terraform_region(result, terrain);
    }
    fix_demand(result);

    tolua_pushusertype(L, result, TOLUA_CAST "region");
    return 1;
  }
  return 0;
}
Beispiel #15
0
/* Type casting
*/
static int tolua_bnd_cast (lua_State* L)
{

/* // old code
        void* v = tolua_tousertype(L,1,NULL);
        const char* s = tolua_tostring(L,2,NULL);
        if (v && s)
         tolua_pushusertype(L,v,s);
        else
         lua_pushnil(L);
        return 1;
*/

	void* v;
	const char* s;
	if (lua_islightuserdata(L, 1)) {
		v = tolua_touserdata(L, 1, NULL);
	} else {
		v = tolua_tousertype(L, 1, 0);
	};

	s = tolua_tostring(L,2,NULL);
	if (v && s)
	 tolua_pushusertype(L,v,s);
	else
	 lua_pushnil(L);
	return 1;
}
static int tolua_cocos2d_CCBProxy_readCCBFromFile(lua_State* tolua_S)
{
    if (NULL == tolua_S)
        return 0;
    
    int argc = 0;
    CCBProxy* self = nullptr;
    const char* ccbFilePath = nullptr;
    CCBReader*  ccbReader   = nullptr;
    bool        setOwner    = false;
    Node*       tolua_ret    = nullptr;
    int         ID          = 0;
    int*        luaID       = nullptr;
    
    
#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
	if (!tolua_isusertype(tolua_S,1,"cc.CCBProxy",0,&tolua_err)) goto tolua_lerror;
#endif
    
    self = static_cast<CCBProxy*>(tolua_tousertype(tolua_S,1,0));
    
#if COCOS2D_DEBUG >= 1
	if (nullptr == self) {
		tolua_error(tolua_S,"invalid 'self' in function 'tolua_cocos2d_CCBProxy_readCCBFromFile'\n", NULL);
		return 0;
	}
#endif
    
    argc = lua_gettop(tolua_S) - 1;
    
    if (2 == argc || 3 == argc)
    {
#if COCOS2D_DEBUG >= 1
        if (!tolua_isstring(tolua_S, 2, 0, &tolua_err)||
            !tolua_isusertype(tolua_S,3,"cc.CCBReader",0,&tolua_err)||
            !tolua_isboolean(tolua_S,4,1,&tolua_err )
            )
            goto tolua_lerror;
#endif
        ccbFilePath = ((const char*)  tolua_tostring(tolua_S,2,0));
        ccbReader   = ((CCBReader*)  tolua_tousertype(tolua_S,3,0));
        setOwner = (bool)  tolua_toboolean(tolua_S,4,-1);
        tolua_ret = (Node*) self->readCCBFromFile(ccbFilePath, ccbReader, setOwner);
        ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
        luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,"cc.Node");
        return 1;
    }
    
    CCLOG("%s function of CCBProxy  has wrong number of arguments: %d, was expecting %d\n", "cc.CCBReader:readCCBFromFile", argc, 2);
    return 0;
    
#if COCOS2D_DEBUG >= 1
tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'tolua_cocos2d_CCBProxy_readCCBFromFile'.",&tolua_err);
    return 0;
#endif
}
Beispiel #17
0
static int lua_ftk_translator_create(lua_State* L)
{
	tolua_Error err = {0};
	FtkTranslator* retv;
	const char* package;
	const char* locale;
	int param_ok = tolua_isstring(L, 1, 0, &err) && tolua_isstring(L, 2, 0, &err);

	return_val_if_fail(param_ok, 0);

	package = tolua_tostring(L, 1, 0);
	locale = tolua_tostring(L, 2, 0);
	retv = ftk_translator_create(package, locale);
	tolua_pushusertype(L, (FtkTranslator*)retv, "FtkTranslator");

	return 1;
}
Beispiel #18
0
static int tolua_faction_create(lua_State * L)
{
    const char *email = tolua_tostring(L, 1, 0);
    const char *racename = tolua_tostring(L, 2, 0);
    const char *lang = tolua_tostring(L, 3, 0);
    struct locale *loc = get_locale(lang);
    faction *f = NULL;
    const struct race *frace = rc_find(racename);
    if (frace != NULL) {
        f = addfaction(email, NULL, frace, loc, 0);
    }
    if (!f) {
        log_error("faction.create(%s, %s, %s)\n", email, racename, lang);
    }
    tolua_pushusertype(L, f, TOLUA_CAST "faction");
    return 1;
}
Beispiel #19
0
static int tolua_faction_addnotice(lua_State * L)
{
    faction *self = (faction *)tolua_tousertype(L, 1, 0);
    const char *str = tolua_tostring(L, 2, 0);

    addmessage(NULL, self, str, MSG_MESSAGE, ML_IMPORTANT);
    return 0;
}
Beispiel #20
0
static int lua_ftk_fs_move(lua_State* L)
{
	tolua_Error err = {0};
	Ret retv;
	char* dir_from;
	char* dir_to;
	int param_ok = tolua_isstring(L, 1, 0, &err) && tolua_isstring(L, 2, 0, &err);

	return_val_if_fail(param_ok, 0);

	dir_from = (char*)tolua_tostring(L, 1, 0);
	dir_to = (char*)tolua_tostring(L, 2, 0);
	retv = ftk_fs_move(dir_from, dir_to);
	tolua_pushnumber(L, (lua_Number)retv);

	return 1;
}
Beispiel #21
0
static int tolua_region_getkey(lua_State * L)
{
    region *self = (region *)tolua_tousertype(L, 1, 0);
    const char *name = tolua_tostring(L, 2, 0);
    int flag = atoi36(name);

    lua_pushboolean(L, key_get(self->attribs, flag));
    return 1;
}
Beispiel #22
0
/* Type casting
*/
static int tolua_bnd_cast (lua_State* L)
{
	void* v = tolua_tousertype(L,1,NULL);
	const char* s = tolua_tostring(L,2,NULL);
	if (v && s)
	 tolua_pushusertype(L,v,s);
	else
	 lua_pushnil(L);
	return 1;
}
Beispiel #23
0
static int tolua_db_execute(lua_State * L)
{
    sqlite3 *db = (sqlite3 *)tolua_tousertype(L, 1, 0);
    const char *sql = tolua_tostring(L, 2, 0);

    int res = sqlite3_exec(db, sql, 0, 0, 0);

    tolua_pushnumber(L, (LUA_NUMBER)res);
    return 1;
}
Beispiel #24
0
static int lua_ftk_infomation(lua_State* L)
{
	tolua_Error err = {0};
	int retv;
	const char* title;
	const char* text;
	const char** buttons;
	int param_ok = tolua_isstring(L, 1, 0, &err) && tolua_isstring(L, 2, 0, &err) && tolua_istable(L, 3, 0, &err);

	return_val_if_fail(param_ok, 0);

	title = tolua_tostring(L, 1, 0);
	text = tolua_tostring(L, 2, 0);
	buttons = tolua_tostrings(L, 3, 0);
	retv = ftk_infomation(title, text, buttons);
	tolua_pushnumber(L, (lua_Number)retv);
	free(buttons);

	return 1;
}
Beispiel #25
0
static int tolua_plane_set_name(lua_State * L)
{
    plane *self = (plane *)tolua_tousertype(L, 1, 0);
    const char *str = tolua_tostring(L, 2, 0);
    free(self->name);
    if (str)
        self->name = _strdup(str);
    else
        self->name = 0;
    return 0;
}
Beispiel #26
0
static int tolua_db_create(lua_State * L)
{
    sqlite3 *db;
    const char *dbname = tolua_tostring(L, 1, 0);
    int result = sqlite3_open_v2(dbname, &db, SQLITE_OPEN_READWRITE, 0);
    if (result == SQLITE_OK) {
        tolua_pushusertype(L, (void *)db, LTYPE_DB);
        return 1;
    }
    return 0;
}
Beispiel #27
0
static int tolua_building_set_info(lua_State * L)
{
    building *self = (building *)tolua_tousertype(L, 1, 0);
    const char *info = tolua_tostring(L, 2, 0);
    free(self->display);
    if (info)
        self->display = _strdup(info);
    else
        self->display = NULL;
    return 0;
}
Beispiel #28
0
static int tolua_faction_set_race(lua_State * L)
{
    faction *self = (faction *)tolua_tousertype(L, 1, 0);
    const char *name = tolua_tostring(L, 2, 0);
    const race *rc = rc_find(name);
    if (rc != NULL) {
        self->race = rc;
    }

    return 0;
}
Beispiel #29
0
static int tolua_make_block(lua_State * L)
{
    int x = (int)tolua_tonumber(L, 1, 0);
    int y = (int)tolua_tonumber(L, 2, 0);
    int r = (int)tolua_tonumber(L, 3, 6);
    const char *str = tolua_tostring(L, 4, TOLUA_CAST "ocean");
    const struct terrain_type *ter = get_terrain(str);

    make_block(x, y, r, ter);
    return 0;
}
Beispiel #30
0
AString cPlugin_NewLua::HandleWebRequest(const HTTPRequest * a_Request )
{
	cCSLock Lock(m_CriticalSection);
	std::string RetVal = "";

	std::pair< std::string, std::string > TabName = GetTabNameForRequest(a_Request);
	std::string SafeTabName = TabName.second;
	if( SafeTabName.empty() )
		return "";

	sWebPluginTab* Tab = 0;
	for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr )
	{
		if( (*itr)->SafeTitle.compare( SafeTabName ) == 0 ) // This is the one! Rawr
		{
			Tab = *itr;
			break;
		}
	}

	if( Tab )
	{
		//LOGINFO("1. Stack size: %i", lua_gettop(m_LuaState) );
		lua_rawgeti( m_LuaState, LUA_REGISTRYINDEX, Tab->UserData); // same as lua_getref()

		//LOGINFO("2. Stack size: %i", lua_gettop(m_LuaState) );
		// Push HTTPRequest
		tolua_pushusertype( m_LuaState, (void*)a_Request, "const HTTPRequest" );
		//LOGINFO("Calling bound function! :D");
		int s = lua_pcall( m_LuaState, 1, 1, 0);

		if ( s != 0 )
		{
			std::string err = lua_tostring(m_LuaState, -1);
			LOGERROR("-- %s", err.c_str() );
			lua_pop(m_LuaState, 1);
			LOGINFO("error. Stack size: %i", lua_gettop(m_LuaState) );
			return err;	// Show the error message in the web page, looks cool
		}

		if( !lua_isstring( m_LuaState, -1 ) )
		{
			LOGWARN("WARNING: WebPlugin tab '%s' did not return a string!", Tab->Title.c_str() );
			lua_pop(m_LuaState, 1); // Pop return value
			return std::string("WARNING: WebPlugin tab '") + Tab->Title + std::string("' did not return a string!");
		}

		RetVal += tolua_tostring(m_LuaState, -1, 0);
		lua_pop(m_LuaState, 1); // Pop return value
		//LOGINFO("ok. Stack size: %i", lua_gettop(m_LuaState) );
	}

	return RetVal;
}