mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-07-13 02:03:44 +00:00
fix sol::error crash
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include <queue>
|
||||
#include <random>
|
||||
#include <set>
|
||||
#include <sol/protected_function_result.hpp>
|
||||
#include <toml.hpp>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
@@ -84,6 +85,11 @@ struct TLuaResult {
|
||||
std::make_shared<std::condition_variable>()
|
||||
};
|
||||
|
||||
void SetErrorMessageFromResult(sol::protected_function_result& Res) {
|
||||
auto error = Res.get<std::optional<std::string>>();
|
||||
ErrorMessage = error ? *error : "(unknown error; error object is not a string value)";
|
||||
}
|
||||
|
||||
void MarkAsReady();
|
||||
void WaitUntilReady();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user