From 01bb57adffe10c592ef4711710f31946ba45546e Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 21 Nov 2020 23:38:45 +0100 Subject: [PATCH] [FIXED] @setenv_XXX commands affect the local rather than edit environment when @setenv restricted and @setenv_daycycle was issued --- indra/newview/rlvenvironment.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/indra/newview/rlvenvironment.cpp b/indra/newview/rlvenvironment.cpp index 5f70df750a..e1bce306de 100644 --- a/indra/newview/rlvenvironment.cpp +++ b/indra/newview/rlvenvironment.cpp @@ -479,16 +479,17 @@ LLSettingsSky::ptr_t RlvEnvironment::getTargetSky(bool forSetCmd) if (forSetCmd) { - bool isSharedEnv = !pEnv->getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL), - hasLocalDayCycle = !isSharedEnv && pEnv->getEnvironmentDay(LLEnvironment::ENV_LOCAL), + LLEnvironment::EnvSelection_t targetEnv = getTargetEnvironment(); + bool isSharedEnv = !pEnv->getEnvironmentFixedSky(targetEnv), + hasLocalDayCycle = !isSharedEnv && pEnv->getEnvironmentDay(targetEnv), isLocalTransition = !hasLocalDayCycle && pEnv->getCurrentEnvironmentInstance()->isTransition(); if ( (isSharedEnv) || (hasLocalDayCycle) || (isLocalTransition) ) { LLSettingsSky::ptr_t pSky = (isSharedEnv) ? pEnv->getEnvironmentFixedSky(LLEnvironment::ENV_PARCEL, true)->buildClone() - : (hasLocalDayCycle) ? pEnv->getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL)->buildClone() - : pEnv->getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL); - pEnv->setEnvironment(LLEnvironment::ENV_LOCAL, pSky); - pEnv->setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); + : (hasLocalDayCycle) ? pEnv->getEnvironmentFixedSky(targetEnv)->buildClone() + : pEnv->getEnvironmentFixedSky(targetEnv); + pEnv->setEnvironment(targetEnv, pSky); + pEnv->setSelectedEnvironment(targetEnv, LLEnvironment::TRANSITION_INSTANT); pEnv->updateEnvironment(LLEnvironment::TRANSITION_INSTANT); } }