diff --git a/Ja2/gameloop.cpp b/Ja2/gameloop.cpp index 88c752f96..b0c04592c 100644 --- a/Ja2/gameloop.cpp +++ b/Ja2/gameloop.cpp @@ -100,7 +100,6 @@ BOOLEAN InitializeGame(void) giStartingMemValue = MemGetFree( ); - //InitializeLua(); is_networked = FALSE; is_client = FALSE; is_server = FALSE; @@ -211,8 +210,6 @@ void ShutdownGame(void) //Deletes all the Temp files in the Maps\Temp directory InitTacticalSave( FALSE ); - //ShutdownLua( ); - FreeGameExternalOptions(); } diff --git a/lua/Lua Interpreter.h b/lua/Lua Interpreter.h index bef02328a..215c09b78 100644 --- a/lua/Lua Interpreter.h +++ b/lua/Lua Interpreter.h @@ -18,7 +18,6 @@ typedef struct { } LuaAttrib; void InitializeLua( ); -int EvalLua (const wchar_t* buff) ; // The return value is whether to clear the input line, not whether the call succeeded. void ShutdownLua( ); extern luaL_Reg WStringMethods[]; diff --git a/lua/lua.cpp b/lua/lua.cpp index b3d1cb32b..721da9b30 100644 --- a/lua/lua.cpp +++ b/lua/lua.cpp @@ -1,9 +1,5 @@ -#include #include -#include #include "Lua Interpreter.h" -#include -#include "MemMan.h" lua_State *L; @@ -181,11 +177,6 @@ void InitializeLua( ) L = lua_open(); luaL_openlibs(L); - // Create the accessor metatable -// CreateLuaType( L, ACCESSOR_TABLE, LuaAccessors); -// lua_setglobal( L, ACCESSOR_TABLE); // We also want this class to be known to the script -// lua_pop(L, 1); - // Create a wide-character savvy string CreateLuaType( L, "wstring", WStringMethods); lua_setglobal( L, "wstring"); // We also want this class to be known to the script @@ -196,37 +187,6 @@ void InitializeLua( ) LuaEnvironmentSetup( L); } -int EvalLua (const wchar_t* buff) { - int error; - int newlen; - STR8 newstr = NULL; - - // Since we get wide chars coming in, we need to convert to UTF8 - newlen = WideCharToMultiByte( CP_UTF8, 0, buff, -1, newstr, 0, NULL, NULL); - newstr = (STR8) MemAlloc( newlen); - WideCharToMultiByte( CP_UTF8, 0, buff, -1, newstr, newlen, NULL, NULL); - - error = luaL_loadbuffer(L, newstr, newlen-1, "line") || - lua_pcall(L, 0, 0, 0); - - MemFree( newstr); - - if (error) { - const char *error = lua_tostring(L, -1); - int len = strlen( error); - if (len >= 7 && !strcmp( error + len - 7, "''")) - { - lua_pop(L, 1); /* pop error message from the stack */ - return FALSE; - } - printf( "%s\n", lua_tostring(L, -1)); - lua_pop(L, 1); /* pop error message from the stack */ - return TRUE; - } - - return TRUE; -} - void ShutdownLua( ) { if(L)