Include :

- aggiunta funzione LuaChangeNameGlobVar.
This commit is contained in:
Dario Sassi
2020-04-19 16:30:33 +00:00
parent dd4380d4d6
commit 9da33d54be
+13 -2
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2020
//----------------------------------------------------------------------------
// File : EGnLuaAux.h Data : 21.03.15 Versione : 1.6c6
// File : EGnLuaAux.h Data : 17.04.20 Versione : 2.2d3
// Contenuto : Funzioni per gestione parametri generali con LUA.
//
//
@@ -551,6 +551,17 @@ LuaResetGlobVar( lua_State* L, const std::string& sVar)
}
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
inline bool
LuaChangeNameGlobVar( lua_State* L, const std::string& sOldVar, const std::string& sNewVar)
{
int nType = lua_getglobal( L, sOldVar.c_str()) ;
if ( nType == LUA_TNONE || nType == LUA_TNIL)
return false ;
lua_setglobal( L, sNewVar.c_str()) ;
return true ;
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------