summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llenvironment.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 5e7e9937cd..ae625630eb 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -507,9 +507,19 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm
DayInstance::ptr_t environment = getEnvironmentInstance(env, true);
+ LLSettingsSky::ptr_t prev_sky = mEnvironments[ENV_DEFAULT]->getSky();
+ LLSettingsWater::ptr_t prev_water = mEnvironments[ENV_DEFAULT]->getWater();
+ if (mCurrentEnvironment && (ENV_EDIT == env))
+ {
+ prev_sky = mCurrentEnvironment->getSky() ? mCurrentEnvironment->getSky() : prev_sky;
+ prev_water = mCurrentEnvironment->getWater() ? mCurrentEnvironment->getWater() : prev_water;
+ }
+
environment->clear();
- environment->setSky((fixed.first) ? fixed.first : mEnvironments[ENV_DEFAULT]->getSky());
- environment->setWater((fixed.second) ? fixed.second : mEnvironments[ENV_DEFAULT]->getWater());
+ environment->setSky((fixed.first) ? fixed.first : prev_sky);
+ environment->setWater((fixed.second) ? fixed.second : prev_water);
+
+
if (!mSignalEnvChanged.empty())
mSignalEnvChanged(env);