diff options
| author | Rider Linden <rider@lindenlab.com> | 2018-08-21 11:37:59 -0700 |
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2018-08-21 11:37:59 -0700 |
| commit | 477c66c890d5d87318705415315aaf9464bec2ff (patch) | |
| tree | 48cdffe375ef2de59eb241c58713ab7a335e37a8 /indra/newview/llenvironment.cpp | |
| parent | 163ae605be8871f37f19d94b71ec4370aadf9a49 (diff) | |
Lest couple nullptr checks and disable the controls on legacy regions.
Diffstat (limited to 'indra/newview/llenvironment.cpp')
| -rw-r--r-- | indra/newview/llenvironment.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index be0c763e25..8f703d0035 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1037,22 +1037,26 @@ void LLEnvironment::requestParcel(S32 parcel_id, environment_apply_fn cb) { if (!isExtendedEnvironmentEnabled()) { /*TODO: When EEP is live on the entire grid, this can go away. */ - if (!cb) + if (parcel_id == INVALID_PARCEL_ID) { - cb = [this](S32 pid, EnvironmentInfo::ptr_t envinfo) - { - if (envinfo->mDayCycle) recordEnvironment(pid, envinfo); - else + if (!cb) + { + cb = [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { - clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); - updateEnvironment(); - } - }; - } + if (envinfo->mDayCycle) recordEnvironment(pid, envinfo); + else + { + clearEnvironment(ENV_PARCEL); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + updateEnvironment(); + } + }; + } - if (parcel_id == INVALID_PARCEL_ID) LLEnvironmentRequest::initiate(cb); + } + else if (cb) + cb(parcel_id, EnvironmentInfo::ptr_t()); return; } |
