From 579aec71184ca4682ea250d2bd0722513525ea01 Mon Sep 17 00:00:00 2001 From: "nissim.hadar" Date: Sat, 6 Jan 2018 01:37:23 -0800 Subject: [PATCH] Only check for zone fields. --- libraries/entities/src/EntityTree.cpp | 30 ++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index ff1b65db15..a0eaefd43e 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -2281,22 +2281,24 @@ bool EntityTree::readFromMap(QVariantMap& map) { properties.setOwningAvatarID(myNodeID); } - // TEMPORARY fix for older content not containing these fields - if (!entityMap.contains("keyLightMode")) { - properties.setKeyLightMode(COMPONENT_MODE_ENABLED); - } - - if (!entityMap.contains("skyboxMode")) { - if (entityMap.contains("backgroundMode") && properties.getBackgroundModeAsString() == "inherit") { - // The content creator has set the combo to NOTHING - this is actually inherit - properties.setSkyboxMode(COMPONENT_MODE_INHERIT); - } else { - properties.setSkyboxMode(COMPONENT_MODE_ENABLED); + // TEMPORARY fix for older content not containing these fields in the zones + if (properties.getType() == EntityTypes::EntityType::Zone) { + if (!entityMap.contains("keyLightMode")) { + properties.setKeyLightMode(COMPONENT_MODE_ENABLED); } - } - if (!entityMap.contains("ambientLightMode")) { - properties.setAmbientLightMode(COMPONENT_MODE_ENABLED); + if (!entityMap.contains("skyboxMode")) { + if (entityMap.contains("backgroundMode") && properties.getBackgroundModeAsString() == "inherit") { + // The content creator has set the combo to NOTHING - this is actually inherit + properties.setSkyboxMode(COMPONENT_MODE_INHERIT); + } else { + properties.setSkyboxMode(COMPONENT_MODE_ENABLED); + } + } + + if (!entityMap.contains("ambientLightMode")) { + properties.setAmbientLightMode(COMPONENT_MODE_ENABLED); + } } EntityItemPointer entity = addEntity(entityItemID, properties);