Browse Source

fix mines serializer

Laserlicht 3 weeks ago
parent
commit
c72a4b0294
1 changed files with 3 additions and 6 deletions
  1. 3 6
      lib/serializer/JsonSerializeFormat.h

+ 3 - 6
lib/serializer/JsonSerializeFormat.h

@@ -346,13 +346,10 @@ public:
 		}
 		else
 		{
-			const JsonNode & node = getCurrent()[fieldName];
-			for (const auto & [keyStr, jsonVal] : node.Struct())
+			for (const auto & [keyStr, jsonVal] : getCurrent()[fieldName].Struct())
 			{
-				Key key = Key::decode(keyStr);
-
-				LIBRARY->identifiers()->requestIdentifier(jsonVal.getModScope(), Key::entityType(), keyStr, [&value, key](int32_t index) {
-					value[key] = T(index);
+				LIBRARY->identifiers()->requestIdentifier(jsonVal.getModScope(), Key::entityType(), keyStr, [&value, jsonVal](int32_t index) {
+					value[Key(index)] = jsonVal.Integer(); // TODO: only int supported yet
 				});
 			}
 		}