Only check for zone fields.

This commit is contained in:
nissim.hadar 2018-01-06 01:37:23 -08:00
parent cf7d6a2eab
commit 579aec7118

View file

@ -2281,22 +2281,24 @@ bool EntityTree::readFromMap(QVariantMap& map) {
properties.setOwningAvatarID(myNodeID); properties.setOwningAvatarID(myNodeID);
} }
// TEMPORARY fix for older content not containing these fields // TEMPORARY fix for older content not containing these fields in the zones
if (!entityMap.contains("keyLightMode")) { if (properties.getType() == EntityTypes::EntityType::Zone) {
properties.setKeyLightMode(COMPONENT_MODE_ENABLED); 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);
} }
}
if (!entityMap.contains("ambientLightMode")) { if (!entityMap.contains("skyboxMode")) {
properties.setAmbientLightMode(COMPONENT_MODE_ENABLED); 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); EntityItemPointer entity = addEntity(entityItemID, properties);