SL-16297 Don't play moap located outside the parcel, If an agent is standing in a parcel with this flag set

meow-7.2.2
Mnikolenko Productengine 2022-05-30 19:07:29 +03:00
parent 14e3104f86
commit 1e09d25d9c
2 changed files with 22 additions and 1 deletions

View File

@ -3103,7 +3103,7 @@ bool LLViewerMediaImpl::isForcedUnloaded() const
}
// If this media's class is not supposed to be shown, unload
if (!shouldShowBasedOnClass())
if (!shouldShowBasedOnClass() || isObscured())
{
return true;
}
@ -3788,6 +3788,26 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const
}
}
//////////////////////////////////////////////////////////////////////////////////////////
//
bool LLViewerMediaImpl::isObscured() const
{
if (getUsedInUI() || isParcelMedia()) return false;
LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!agent_parcel)
{
return false;
}
if (agent_parcel->getObscureMOAP() && !isInAgentParcel())
{
return true;
}
return false;
}
//////////////////////////////////////////////////////////////////////////////////////////
//
bool LLViewerMediaImpl::isAttachedToAnotherAvatar() const

View File

@ -421,6 +421,7 @@ public:
private:
bool isAutoPlayable() const;
bool shouldShowBasedOnClass() const;
bool isObscured() const;
static bool isObjectAttachedToAnotherAvatar(LLVOVolume *obj);
static bool isObjectInAgentParcel(LLVOVolume *obj);