From 08ba035a530b4003adebe14732f011a8c1e38ad0 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 15 Jul 2017 16:27:11 -0400 Subject: [PATCH] fix nesting checks --- src/client/GameSave.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index e2253dd09..b36648d14 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -2395,7 +2395,12 @@ std::set GetNestedSaveIDs(Json::Value j) { for (Json::Value::ArrayIndex i = 0; i < j[member].size(); i++) { - // only supports objects here because that is all we need + // only supports objects and ints here because that is all we need + if (j[member][i].isInt()) + { + saveIDs.insert(j[member][i].asInt()); + continue; + } if (!j[member][i].isObject()) continue; std::set nestedSaveIDs = GetNestedSaveIDs(j[member][i]); @@ -2427,7 +2432,12 @@ void GameSave::ConvertJsonToBson(bson *b, Json::Value j, int depth) std::set saveIDs = std::set(); for (Json::Value::ArrayIndex i = 0; i < j[member].size(); i++) { - // only supports objects here because that is all we need + // only supports objects and ints here because that is all we need + if (j[member][i].isInt()) + { + saveIDs.insert(j[member][i].asInt()); + continue; + } if (!j[member][i].isObject()) continue; if (depth > 4)