diff options
author | Rider Linden <rider@lindenlab.com> | 2018-11-21 12:52:35 -0800 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-11-21 12:52:35 -0800 |
commit | 8d3e5a3eac51170946e6f32a28f26fa523753d90 (patch) | |
tree | 505bbbfaf37f821a049fab0af4b9932b9b26d9ae /indra/newview/llpanelenvironment.cpp | |
parent | 8067bd824ecbf0f2c63a27937f3e36c4cbc99418 (diff) | |
parent | 62720cf5dd5c11eaf08e90ce281d6d084ae017f0 (diff) |
Merge
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index df595632f8..8c86e3e8e4 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -797,16 +797,21 @@ void LLPanelEnvironmentInfo::onEnvironmentChanged(LLEnvironment::EnvSelection_t // Panel receives environment from different sources, from environment update callbacks, // from hovers (causes callbacks on version change) and from personal requests // filter out dupplicates and out of order packets by checking parcel environment version. - LL_DEBUGS("ENVPANEL") << "Received environment update " << mCurEnvVersion << " " << (getParcel() ? getParcel()->getParcelEnvironmentVersion() : (S32)-1) << LL_ENDL; LLParcel *parcel = getParcel(); - if (parcel && mCurEnvVersion < parcel->getParcelEnvironmentVersion()) - { - mCurrentEnvironment.reset(); - refreshFromSource(); - } - else + if (parcel) { - refresh(); + S32 new_version = parcel->getParcelEnvironmentVersion(); + LL_DEBUGS("ENVPANEL") << "Received environment update " << mCurEnvVersion << " " << new_version << LL_ENDL; + if (mCurEnvVersion < new_version + || (mCurEnvVersion != new_version && new_version == UNSET_PARCEL_ENVIRONMENT_VERSION)) + { + mCurrentEnvironment.reset(); + refreshFromSource(); + } + else + { + refresh(); + } } } } @@ -837,16 +842,24 @@ void LLPanelEnvironmentInfo::onEnvironmentReceived(S32 parcel_id, LLEnvironment: if (parcel_id == INVALID_PARCEL_ID) { // region, no version - mCurEnvVersion = 1; + // -2 for invalid version viewer -1 for invalid version from server + mCurEnvVersion = UNSET_PARCEL_ENVIRONMENT_VERSION; } else { LLParcel* parcel = getParcel(); - if (parcel) + if (parcel + && mCurrentEnvironment->mDayCycle + && mCurrentEnvironment->mDayCycle->getAssetId() != LLSettingsDay::GetDefaultAssetId()) { // not always up to date, we will get onEnvironmentChanged() update in such case. mCurEnvVersion = parcel->getParcelEnvironmentVersion(); } + else + { + // When using 'region' as parcel environment + mCurEnvVersion = UNSET_PARCEL_ENVIRONMENT_VERSION; + } LL_DEBUGS("ENVPANEL") << " Setting environment version: " << mCurEnvVersion << LL_ENDL; } refresh(); |