Don't enforce key presence in models.json

This commit is contained in:
Simon Walton 2018-11-16 17:33:13 -08:00
parent da3ea682ba
commit 3baebf55c5

View file

@ -46,8 +46,13 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
bool gotId = false; bool gotId = false;
bool gotVersion = false; bool gotVersion = false;
while (!(gotDataVersion && gotEntities && gotId && gotVersion)) { int token = nextToken();
if (nextToken() != '"') {
while (true) {
if (token == '}') {
break;
}
else if (token != '"') {
_errorString = "Incorrect key string"; _errorString = "Incorrect key string";
return false; return false;
} }
@ -144,15 +149,13 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
return false; return false;
} }
if (gotDataVersion && gotEntities && gotId && gotVersion) { token = nextToken();
break; if (token == ',') {
} else if (nextToken() != ',') { token = nextToken();
_errorString = "Id/value incorrectly terminated";
return false;
} }
} }
if (nextToken() != '}' || nextToken() != -1) { if (nextToken() != -1) {
_errorString = "Ill-formed end of object"; _errorString = "Ill-formed end of object";
return false; return false;
} }