Skip to content
Snippets Groups Projects
Commit 26ef8e6c authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

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
parent 30bcce4e
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment