From 30b038a6bb2e8cdf0c2e70b6818d039bbe9ac732 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Sun, 6 Nov 2022 01:34:37 +0100 Subject: [PATCH] revert adding nil to json it causes issues, not worth it --- src/LuaAPI.cpp | 2 -- src/TLuaEngine.cpp | 1 - 2 files changed, 3 deletions(-) diff --git a/src/LuaAPI.cpp b/src/LuaAPI.cpp index 2b8155d..2882dff 100644 --- a/src/LuaAPI.cpp +++ b/src/LuaAPI.cpp @@ -551,8 +551,6 @@ static void JsonEncodeRecursive(nlohmann::json& json, const sol::object& left, c nlohmann::json value; switch (right.get_type()) { case sol::type::lua_nil: - value = nullptr; - return; case sol::type::none: return; case sol::type::poly: diff --git a/src/TLuaEngine.cpp b/src/TLuaEngine.cpp index 761a449..9bf01f3 100644 --- a/src/TLuaEngine.cpp +++ b/src/TLuaEngine.cpp @@ -674,7 +674,6 @@ static void AddToTable(sol::table& table, const std::string& left, const T& valu static void JsonDecodeRecursive(sol::state_view& StateView, sol::table& table, const std::string& left, const nlohmann::json& right) { switch (right.type()) { case nlohmann::detail::value_t::null: - AddToTable(table, left, sol::lua_nil_t {}); return; case nlohmann::detail::value_t::object: { auto value = table.create();