From 50a030b68b8d8f06a42be7e4f5ca91cb478febe6 Mon Sep 17 00:00:00 2001 From: Nissim Hadar Date: Fri, 12 Jan 2018 00:22:06 -0800 Subject: [PATCH] Corrected copy of ambient URL. --- libraries/entities/src/EntityTree.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index b7b560290e..907426c922 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -2242,7 +2242,7 @@ bool EntityTree::readFromMap(QVariantMap& map) { // map will have a top-level list keyed as "Entities". This will be extracted // and iterated over. Each member of this list is converted to a QVariantMap, then // to a QScriptValue, and then to EntityItemProperties. These properties are used - // to add the new entity to the EnitytTree. + // to add the new entity to the EntityTree. QVariantList entitiesQList = map["Entities"].toList(); QScriptEngine scriptEngine; @@ -2286,7 +2286,10 @@ bool EntityTree::readFromMap(QVariantMap& map) { // Fix for older content not containing these fields in the zones if (needsConversion && (properties.getType() == EntityTypes::EntityType::Zone)) { // The ambient URL has been moved from "keyLight" to "ambientLight" - properties.getAmbientLight().setAmbientURL(entityMap["ambientURL"].toString()); + if (entityMap.contains("keyLight")) { + QVariantMap keyLightObject = entityMap["keyLight"].toMap(); + properties.getAmbientLight().setAmbientURL(keyLightObject["ambientURL"].toString()); + } // The background should be enabled if the mode is skybox // Note that if the values are default then they are not stored in the JSON file