Skip to content

Commit

Permalink
Hmmm
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed Apr 4, 2024
1 parent b9f18dd commit e710d00
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions source/lua_ILuaInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,24 +153,18 @@ void HandleError(ILuaInterface* LUA, int result, const char* pFile)
{
if (result != 0)
{
func_AdvancedLuaErrorReporter(LUA->GetState());
const char* err = func_lua_tostring(LUA->GetState(), -1, NULL);
LUA->Pop();

Msg("[ERROR] ILuaInterface:RunString: %s (%s)\n", err, pFile);
//func_AdvancedLuaErrorReporter(LUA->GetState());
return;
}
}

void RunString(ILuaThread* thread, const char* str, const char* pFile)
{
ILuaInterface* LUA = thread->IFace;
Msg("1. Top %i\n", LUA->Top());
LUA->Push(-2);
LUA->Push(-2);
LUA->RunStringEx(pFile, "", str, true, true, true, true);
Msg("2. Top %i\n", LUA->Top());
/*
if (setjmp(thread->jumpBuffer) == 0)
{
int result = func_luaL_loadbuffer(LUA->GetState(), str, strlen(str), pFile);
Expand All @@ -183,12 +177,13 @@ void RunString(ILuaThread* thread, const char* str, const char* pFile)

if (setjmp(thread->jumpBuffer) == 0)
{
LUA->CallFunctionProtected(0, 0, false);
int result = LUA->PCall(0, 0, 0);
HandleError(LUA, result, pFile);
}
else
{
HandleError(LUA, -1, pFile); // Could crash if the Lua Panic wan't created by pcall or loadstring.
}*/
}
}

LUA_FUNCTION(ILuaInterface_RunString)
Expand Down

0 comments on commit e710d00

Please sign in to comment.