From bd7082f57ea4e6331af3a4d2e89f74a243278470 Mon Sep 17 00:00:00 2001 From: Koncord Date: Wed, 1 Nov 2017 21:48:42 +0800 Subject: [PATCH] [Server] Use custom Lua error handler not only on Windows For some reason sol's default error handler does not wroking properly --- apps/openmw-mp/Script/LuaState.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw-mp/Script/LuaState.cpp b/apps/openmw-mp/Script/LuaState.cpp index 6a4e796af..1a4184dde 100644 --- a/apps/openmw-mp/Script/LuaState.cpp +++ b/apps/openmw-mp/Script/LuaState.cpp @@ -32,7 +32,7 @@ using namespace std; -#if defined(SOL_SAFE_FUNCTIONS) && defined(WIN32) +#if defined(SOL_SAFE_FUNCTIONS) inline int errHandler(lua_State *L) { string msg = "An unknown error has triggered the default error handler"; @@ -107,7 +107,7 @@ LuaState::LuaState() // Enable a special Sol error handler for Windows, because exceptions aren't caught properly // in main.cpp for it -#if defined(SOL_SAFE_FUNCTIONS) && defined(WIN32) +#if defined(SOL_SAFE_FUNCTIONS) lua_CFunction f = sol::c_call; sol::protected_function::set_default_handler(sol::object(lua->lua_state(), sol::in_place, f)); #endif