Include :
- corretta funzione inline LuaChangeNameGlobVar perché non gestiva correttamente lo stack di lua.
This commit is contained in:
+5
-3
@@ -1,13 +1,13 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2020
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EGnLuaAux.h Data : 17.04.20 Versione : 2.2d3
|
||||
// File : EGnLuaAux.h Data : 30.07.20 Versione : 2.2g1
|
||||
// Contenuto : Funzioni per gestione parametri generali con LUA.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 21.03.15 DS Creazione modulo.
|
||||
//
|
||||
// 30.07.20 DS Corretta LuaChangeNameGlobVar (mancava pop se non c'è var).
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
@@ -557,8 +557,10 @@ 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)
|
||||
if ( nType == LUA_TNONE || nType == LUA_TNIL) {
|
||||
lua_pop( L, 1) ;
|
||||
return false ;
|
||||
}
|
||||
lua_setglobal( L, sNewVar.c_str()) ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user