detect recursion in LuaToString

This commit is contained in:
Lion Kortlepel 2021-10-01 03:35:13 +02:00
parent 243e96d503
commit ae7a63669f
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -7,6 +7,9 @@
#include <sol/sol.hpp>
static std::string LuaToString(const sol::object Value, size_t Indent = 1) {
if (Indent > 80) {
return "[[possible recursion, refusing to keep printing]]";
}
switch (Value.get_type()) {
case sol::type::userdata: {
std::stringstream ss;