From 62720cf5dd5c11eaf08e90ce281d6d084ae017f0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 21 Nov 2018 19:04:28 +0200 Subject: SL-9661 Settings applied from inventory don't update about land floater. --- indra/llinventory/llparcel.h | 3 ++- indra/newview/llpanelenvironment.cpp | 33 +++++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 067391b5a1..3b39aeb56b 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -103,8 +103,9 @@ const U32 RT_SELL = 0x1 << 5; const S32 INVALID_PARCEL_ID = -1; -// if Region settings are used, parcel env. version is -1 const S32 INVALID_PARCEL_ENVIRONMENT_VERSION = -2; +// if Region settings are used, parcel env. version is -1 +const S32 UNSET_PARCEL_ENVIRONMENT_VERSION = -1; // Timeouts for parcels // default is 21 days * 24h/d * 60m/h * 60s/m *1000000 usec/s = 1814400000000 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(); -- cgit v1.2.3