aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/common/c_content.cpp7
-rw-r--r--src/script/lua_api/l_util.cpp2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 06e20c2a0..c664101ea 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "porting.h"
#include "mg_schematic.h"
#include "noise.h"
-#include "json/json.h"
+#include <json/json.h>
struct EnumString es_TileAnimationType[] =
{
@@ -1250,8 +1250,13 @@ static bool push_json_value_helper(lua_State *L, const Json::Value &value,
lua_newtable(L);
for (Json::Value::const_iterator it = value.begin();
it != value.end(); ++it) {
+#ifndef JSONCPP_STRING
const char *str = it.memberName();
lua_pushstring(L, str ? str : "");
+#else
+ std::string str = it.name();
+ lua_pushstring(L, str.c_str());
+#endif
push_json_value_helper(L, *it, nullindex);
lua_rawset(L, -3);
}
diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp
index 95a5fc4d1..13c0d702f 100644
--- a/src/script/lua_api/l_util.cpp
+++ b/src/script/lua_api/l_util.cpp
@@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "common/c_content.h"
#include "cpp_api/s_async.h"
#include "serialization.h"
-#include "json/json.h"
+#include <json/json.h>
#include "cpp_api/s_security.h"
#include "porting.h"
#include "debug.h"