mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-07 16:26:04 +00:00
use a beammp_lua_errorf instead of a std::terminate on sol2 assertion failure
This commit is contained in:
@@ -19,6 +19,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 {
|
||||
|
||||
@@ -91,7 +91,7 @@ int BeamMPServerMain(MainArguments Arguments) {
|
||||
Application::Console().WriteRaw(fmt::format("BeamMP Server v{} ({})", Application::ServerVersionString(), BEAMMP_GIT_HASH));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
std::string ConfigPath = "ServerConfig.toml";
|
||||
if (Parser.FoundArgument({ "config" })) {
|
||||
auto MaybeConfigPath = Parser.GetValueOfArgument({ "config" });
|
||||
|
||||
Reference in New Issue
Block a user