mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-08-16 16:26:26 +00:00
Fix lua assertions crashing the server (#198)
The server would crash on a Lua plugin ASSERT() - this now instead prints an error. May still lead to weird behavior, but less weird than a crash.
This commit is contained in:
commit
b0cf5c7838
@ -39,6 +39,9 @@
|
||||
#include <vector>
|
||||
|
||||
#define SOL_ALL_SAFETIES_ON 1
|
||||
#define SOL_USER_C_ASSERT SOL_ON
|
||||
#define SOL_C_ASSERT(...) \
|
||||
beammp_lua_errorf("SOL2 assertion failure: Assertion `{}` failed in {}:{}. This *should* be a fatal error, but BeamMP Server overrides it to not be fatal. This may cause the Lua Engine to crash, or cause other issues.", #__VA_ARGS__, __FILE__, __LINE__)
|
||||
#include <sol/sol.hpp>
|
||||
|
||||
struct JsonString {
|
||||
|
Loading…
x
Reference in New Issue
Block a user