aboutsummaryrefslogtreecommitdiff
path: root/src/shared/lua_api
diff options
context:
space:
mode:
authorAlexander <alex@cogarr.net>2019-02-10 18:07:03 -0500
committerAlexander <alex@cogarr.net>2019-02-10 18:07:03 -0500
commit6326eba6d844d079edf51b44bab8b9f9c21a8fb7 (patch)
tree1375a5c8185553caa6a4fad1e64f2a4c102a303f /src/shared/lua_api
parent9dcfc152d08ed0bc3b415622cab3c764127097d0 (diff)
downloadbrokengine-6326eba6d844d079edf51b44bab8b9f9c21a8fb7.tar.gz
brokengine-6326eba6d844d079edf51b44bab8b9f9c21a8fb7.tar.bz2
brokengine-6326eba6d844d079edf51b44bab8b9f9c21a8fb7.zip
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.
Diffstat (limited to 'src/shared/lua_api')
-rw-r--r--src/shared/lua_api/common.cpp7
-rw-r--r--src/shared/lua_api/common.hpp2
2 files changed, 6 insertions, 3 deletions
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