summaryrefslogtreecommitdiff
path: root/indra/newview/llwaterparammanager.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-05-19 21:10:34 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-05-19 21:10:34 +0300
commit0c358f78ab618de8727892a50cd3a3055dbdf956 (patch)
treef9d14f1717359eff41320d0a9f156f80fdecccf2 /indra/newview/llwaterparammanager.cpp
parentf02d6e7095d526bc7abc75cc796dc4f07c9b18c7 (diff)
STORM-1269 FIXED Teleport to a region that has no env. settings now resets environment to defaults.
Diffstat (limited to 'indra/newview/llwaterparammanager.cpp')
-rw-r--r--indra/newview/llwaterparammanager.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index 3f4a88688e..81d2b92647 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -264,11 +264,27 @@ void LLWaterParamManager::applyUserPrefs(bool interpolate)
LLSD target_water_params;
// Determine new water settings based on user prefs.
+
+ {
+ // Fall back to default water.
+ LLWaterParamSet default_water;
+ getParamSet("Default", default_water);
+ target_water_params = default_water.getAll();
+ }
+
if (LLEnvManagerNew::instance().getUseRegionSettings())
{
// *TODO: make sure whether region settings belong to the current region?
- LL_DEBUGS("Windlight") << "Applying region water" << LL_ENDL;
- target_water_params = LLEnvManagerNew::instance().getRegionSettings().getWaterParams();
+ const LLSD& region_water_params = LLEnvManagerNew::instance().getRegionSettings().getWaterParams();
+ if (region_water_params.size() != 0) // region has no water settings
+ {
+ LL_DEBUGS("Windlight") << "Applying region water" << LL_ENDL;
+ target_water_params = region_water_params;
+ }
+ else
+ {
+ LL_DEBUGS("Windlight") << "Applying default water" << LL_ENDL;
+ }
}
else
{
@@ -280,7 +296,7 @@ void LLWaterParamManager::applyUserPrefs(bool interpolate)
}
// Apply them with or without interpolation.
- if (target_water_params.isUndefined())
+ if (target_water_params.size() == 0)
{
llwarns << "Undefined target water params" << llendl;
return;