From 8f45eb913c6fad38735f00db818e03c4123904aa Mon Sep 17 00:00:00 2001 From: Snoopy Pfeffer Date: Thu, 5 Apr 2012 11:10:05 +0200 Subject: Revert last commit --- .../Region/CoreModules/World/Land/LandObject.cs | 47 ++++++++++++---------- 1 file changed, 25 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index a7c7cc5..ced7b52 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -424,34 +424,37 @@ namespace OpenSim.Region.CoreModules.World.Land { if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) { - bool isMember; - if (m_groupMemberCache.TryGetValue(avatar, out isMember)) - return isMember; - - IGroupsModule groupsModule = m_scene.RequestModuleInterface(); - if (groupsModule == null) + ScenePresence sp; + if (!m_scene.TryGetScenePresence(avatar, out sp)) { - m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); - return false; - } + bool isMember; + if (m_groupMemberCache.TryGetValue(avatar, out isMember)) + return isMember; - GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar); - if (membership == null || membership.Length == 0) - { - m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); - return false; - } + IGroupsModule groupsModule = m_scene.RequestModuleInterface(); + if (groupsModule == null) + return false; - foreach (GroupMembershipData d in membership) - { - if (d.GroupID == LandData.GroupID) + GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar); + if (membership == null || membership.Length == 0) { - m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout); - return true; + m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); + return false; } + + foreach (GroupMembershipData d in membership) + { + if (d.GroupID == LandData.GroupID) + { + m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout); + return true; + } + } + m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); + return false; } - m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); - return false; + + return sp.ControllingClient.IsGroupMember(LandData.GroupID); } return false; } -- cgit v1.1