summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaJson.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2020-05-09 16:51:15 +0200
committerGitHub <noreply@github.com>2020-05-09 16:51:15 +0200
commite6634ed26c50e99f6ccd285235fe477cb4168b06 (patch)
treeb533a69db545835a886bcd8c5b05609b4c830d11 /src/Bindings/LuaJson.cpp
parentUpgrade to C++17 [CI] (#4716) (diff)
downloadcuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.gz
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.bz2
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.lz
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.xz
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.zst
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.zip
Diffstat (limited to 'src/Bindings/LuaJson.cpp')
-rw-r--r--src/Bindings/LuaJson.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Bindings/LuaJson.cpp b/src/Bindings/LuaJson.cpp
index ef042d44d..1cd88cf96 100644
--- a/src/Bindings/LuaJson.cpp
+++ b/src/Bindings/LuaJson.cpp
@@ -9,6 +9,7 @@
#include "LuaState.h"
#include "tolua++/include/tolua++.h"
#include "json/json.h"
+#include "../JsonUtils.h"
@@ -295,10 +296,10 @@ static int tolua_cJson_Parse(lua_State * a_LuaState)
// Parse the string:
Json::Value root;
- Json::Reader reader;
- if (!reader.parse(input, root, false))
+ AString ParseError;
+ if (!JsonUtils::ParseString(input, root, &ParseError))
{
- L.Push(cLuaState::Nil, Printf("Parsing Json failed: %s", reader.getFormattedErrorMessages().c_str()));
+ L.Push(cLuaState::Nil, Printf("Parsing Json failed: %s", ParseError));
return 2;
}