exclude NPCs on adults and anonymous parcel access check

master
UbitUmarov 2020-01-11 17:32:33 +00:00
parent c2cef470f5
commit f417a647db
1 changed files with 10 additions and 1 deletions

View File

@ -748,7 +748,16 @@ namespace OpenSim.Region.CoreModules.World.Land
(m_scene.RegionInfo.EstateSettings.DenyAnonymous || ((LandData.Flags & (uint)ParcelFlags.DenyAnonymous) != 0)); (m_scene.RegionInfo.EstateSettings.DenyAnonymous || ((LandData.Flags & (uint)ParcelFlags.DenyAnonymous) != 0));
if(adults || anonymous) if(adults || anonymous)
{ {
int userflags = m_scene.GetUserFlags(avatar); // this is heavy int userflags;
if(m_scene.TryGetScenePresence(avatar, out ScenePresence snp))
{
if(snp.IsNPC)
return false;
userflags = snp.UserFlags;
}
else
userflags = m_scene.GetUserFlags(avatar);
if(adults && ((userflags & 32) == 0)) if(adults && ((userflags & 32) == 0))
return true; return true;
if(anonymous && ((userflags & 4) == 0)) if(anonymous && ((userflags & 4) == 0))