From 766e885a1b1c5afb7a62f11b427b6d135adeab87 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 10 Sep 2021 23:16:46 +0200 Subject: Clean up/improve some scriptapi error handling code --- src/script/cpp_api/s_base.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/script/cpp_api/s_base.h') diff --git a/src/script/cpp_api/s_base.h b/src/script/cpp_api/s_base.h index 7a8ebc85a..06df2abe3 100644 --- a/src/script/cpp_api/s_base.h +++ b/src/script/cpp_api/s_base.h @@ -128,8 +128,11 @@ protected: lua_State* getStack() { return m_luastack; } + // Checks that stack size is sane void realityCheck(); + // Takes an error from lua_pcall and throws it as a LuaError void scriptError(int result, const char *fxn); + // Dumps stack contents for debugging void stackDump(std::ostream &o); void setGameDef(IGameDef* gamedef) { m_gamedef = gamedef; } -- cgit v1.2.3