diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-10-09 18:39:53 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-10-09 18:47:49 +0300 |
commit | 26ef8e6c65c53b00be09400897761239ca15187c (patch) | |
tree | 097b022d622c97d5d089bc1479143d6f8f18c11c /indra/newview | |
parent | 30bcce4e7a18e0a249f8d2fe029c91b27291e072 (diff) |
SL-14078 Validate region id for environments
It is possible for agent to pass multiple region borders fast, resulting in environment updates affecting wrong regions
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llenvironment.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 342ee3ccf5..647e9bee22 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1612,6 +1612,17 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader) void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo, LLSettingsBase::Seconds transition) { + if (!gAgent.getRegion()) + { + return; + } + // mRegionId id can be null, no specification as to why and if it's valid so check valid ids only + if (gAgent.getRegion()->getRegionID() != envinfo->mRegionId && envinfo->mRegionId.notNull()) + { + LL_INFOS("ENVIRONMENT") << "Requested environmend region id: " << envinfo->mRegionId << " agent is on: " << gAgent.getRegion()->getRegionID() << LL_ENDL; + return; + } + if (envinfo->mParcelId == INVALID_PARCEL_ID) { // the returned info applies to an entire region. |