From 6326eba6d844d079edf51b44bab8b9f9c21a8fb7 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 10 Feb 2019 18:07:03 -0500 Subject: Added the pusherrfunc into the common lua functions Added a header for pusherrorfunc(lua_State* L) to the shared/lua_api/common.hpp header also deleted some prints, and fixed a bug that would show up in an edge case of printing error messages. --- src/shared/lua_api/common.cpp | 7 ++++--- src/shared/lua_api/common.hpp | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/shared/lua_api') diff --git a/src/shared/lua_api/common.cpp b/src/shared/lua_api/common.cpp index 57d1db0..1ee4b72 100644 --- a/src/shared/lua_api/common.cpp +++ b/src/shared/lua_api/common.cpp @@ -261,10 +261,11 @@ int errfunc(lua_State *L){ lua_pop(L, 2); return 1; } - lua_pushvalue(L, -4); //error,{debug},print,debug.traceback,error + //lua_pushvalue(L, -4); //error,{debug},print,debug.traceback,error //lua_pushinteger(L, 3); //error,{debug},print,debug.traceback,error,2 - lua_call(L, 2, 1);//error,{debug},print,str_traceback - printf("Error:%s\n",lua_tostring(L,-1)); + lua_call(L, 0, 1); + //lua_call(L, 2, 1);//error,{debug},print,str_traceback + printf("--------------------------\n"); lua_call(L,1,0);//error,{debug} lua_pop(L,1); printf("Returning"); diff --git a/src/shared/lua_api/common.hpp b/src/shared/lua_api/common.hpp index 583ab1e..ba89521 100644 --- a/src/shared/lua_api/common.hpp +++ b/src/shared/lua_api/common.hpp @@ -23,4 +23,6 @@ int popvector2i(lua_State*,long*,long*); int poprecti(lua_State* L,long*,long*,long*,long*); int pushrecti(lua_State* L,long,long,long,long); + +void pusherrorfunc(lua_State *L); #endif -- cgit v1.2.3-70-g09d2