Include :
- aggiunta funzione LuaChangeNameGlobVar.
This commit is contained in:
+13
-2
@@ -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 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user