diff options
author | Rider Linden <rider@lindenlab.com> | 2018-08-08 15:41:28 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-08-08 15:41:28 -0700 |
commit | 881ee670d92f13ac518a74e1bff81bf69e07ccfa (patch) | |
tree | 23d96163b2aac869bd6ec64b32b8f1fc79d0c7dd /indra/newview/llenvironment.cpp | |
parent | 51abc168c03f80d63c85d4bb48624f440b585390 (diff) |
Fix for mac build
MAINT-8870, MAINT-8871: When legacy windlight fails load the default day cycle asset and use that.
Diffstat (limited to 'indra/newview/llenvironment.cpp')
-rw-r--r-- | indra/newview/llenvironment.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 8f6a94962f..b2bd20d809 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -423,13 +423,17 @@ void LLEnvironment::onLegacyRegionSettings(LLSD data) LLUUID regionId = data[0]["regionID"].asUUID(); LLSettingsDay::ptr_t regionday; - if (data[1].isUndefined()) - regionday = LLSettingsVODay::buildDefaultDayCycle(); - else + if (!data[1].isUndefined()) regionday = LLSettingsVODay::buildFromLegacyMessage(regionId, data[1], data[2], data[3]); clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, regionday, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + if (!regionday) + { + LL_WARNS("ENVIRONMENT") << "Unable to create day from legacy. Using default day cycle." << LL_ENDL; + setEnvironment(LLEnvironment::ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + } + else + setEnvironment(ENV_REGION, regionday, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); updateEnvironment(); } @@ -570,12 +574,17 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId) { - LLSettingsVOBase::getSettingsAsset(assetId, - [this, env](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onSetEnvAssetLoaded(env, asset_id, settings, status); }); + setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); +} + +void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset) +{ + LLSettingsVOBase::getSettingsAsset(assetId, + [this, env, daylength, dayoffset](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, status); }); } -void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status) +void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 status) { if (!settings || status) { |