From 90b825cda8eac02d9bb0af0dd734a662014b4d26 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 28 Jun 2016 23:30:04 +0100 Subject: if a NPC is owned, allow access if ownerID matchs parcel owner or it is in the access list. option OS_NPC_OBJECT_GROUP it still needed if access is by group (this option should also work with not owned NPC) NEEDS TESTING, may prove to be a bad solution --- .../Region/CoreModules/World/Land/LandObject.cs | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 6b37dad..4cea7bb 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -694,7 +694,30 @@ namespace OpenSim.Region.CoreModules.World.Land if (HasGroupAccess(avatar)) return false; - return !IsInLandAccessList(avatar); + if(IsInLandAccessList(avatar)) + return false; + + // check for a NPC + ScenePresence sp; + if (!m_scene.TryGetScenePresence(avatar, out sp)) + return true; + + if(sp==null || !sp.isNPC) + return true; + + INPC npccli = (INPC)sp.ControllingClient; + if(npccli== null) + return true; + + UUID owner = npccli.Owner; + + if(owner == UUID.Zero) + return true; + + if (owner == LandData.OwnerID) + return false; + + return !IsInLandAccessList(owner); } public bool IsInLandAccessList(UUID avatar) -- cgit v1.1