From d5cd0c7b4425e25b11a1ceec154a5c752d508a42 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 26 Jun 2019 16:14:00 -0400 Subject: Major refactor of physics code Move all the physics code into the shared directory, and fix the ghost objects (aabb only) --- src/shared/lua_api/common.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/shared/lua_api/common.cpp') diff --git a/src/shared/lua_api/common.cpp b/src/shared/lua_api/common.cpp index 1ee4b72..9b833fe 100644 --- a/src/shared/lua_api/common.cpp +++ b/src/shared/lua_api/common.cpp @@ -5,6 +5,7 @@ extern "C" { #include } +#include #include "common.hpp" //Expose things to the lua state @@ -236,6 +237,9 @@ int popvector2i(lua_State* L, long* a, long* b){ return 0; } +//When crashy is enabled, errors that usually get caught by errfunc crash instead +//Useful for testing +bool crashy = false; //errfunc("mssg",false) int errfunc(lua_State *L){ printf("Error function called\n"); @@ -268,9 +272,18 @@ int errfunc(lua_State *L){ printf("--------------------------\n"); lua_call(L,1,0);//error,{debug} lua_pop(L,1); - printf("Returning"); + printf("Returning:"); + printf("crashy is %d", crashy); + if(crashy){ + exit(-1); + } return 1; } void pusherrorfunc(lua_State *L){ lua_pushcfunction(L,errfunc); } +int make_crashy(lua_State *L){ + crashy = true; + printf("Setting crashy to %d\n",crashy); + return 0; +} -- cgit v1.2.3-70-g09d2