- new debug system
This commit is contained in:
8
lua.cpp
8
lua.cpp
@@ -914,14 +914,14 @@ void lua_init(char* filenames) {
|
||||
int size;
|
||||
char* buffer = file_getfilebuffer(file_start, size);
|
||||
if (luaL_loadbuffer(L, buffer, size, file_start)) {
|
||||
debug("error loading game");
|
||||
debug("LOADING ERROR:");
|
||||
debug(lua_tostring(L, -1));
|
||||
lua_pop(L,1);
|
||||
return;
|
||||
}
|
||||
free(buffer);
|
||||
if (lua_pcall(L,0, LUA_MULTRET, 0)) {
|
||||
debug("runtime error");
|
||||
debug("RUNTIME ERROR:");
|
||||
debug(lua_tostring(L, -1));
|
||||
lua_pop(L,1);
|
||||
return;
|
||||
@@ -945,7 +945,7 @@ void lua_call_init() {
|
||||
if (!init_exists) return;
|
||||
lua_getglobal(L, "_init");
|
||||
if (lua_pcall(L, 0, 0, 0)) {
|
||||
debug("runtime error");
|
||||
debug("RUNTIME ERROR:");
|
||||
debug(lua_tostring(L, -1));
|
||||
lua_pop(L,1);
|
||||
is_playing = false;
|
||||
@@ -956,7 +956,7 @@ void lua_call_update() {
|
||||
if (!update_exists) return;
|
||||
lua_getglobal(L, "_update");
|
||||
if (lua_pcall(L, 0, 0, 0)) {
|
||||
debug("runtime error");
|
||||
debug("RUNTIME ERROR:");
|
||||
debug(lua_tostring(L, -1));
|
||||
lua_pop(L,1);
|
||||
is_playing = false;
|
||||
|
||||
Reference in New Issue
Block a user