diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index bd1dd66..d0517b7 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -290,28 +290,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
290 | 290 | ||
291 | public bool HasGroupAccess(UUID avatar) | 291 | public bool HasGroupAccess(UUID avatar) |
292 | { | 292 | { |
293 | if ((LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) | 293 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) |
294 | { | 294 | { |
295 | IGroupsModule groupsModule = | 295 | ScenePresence sp; |
296 | m_scene.RequestModuleInterface<IGroupsModule>(); | 296 | if (!m_scene.TryGetScenePresence(avatar, out sp)) |
297 | return false; | ||
297 | 298 | ||
298 | List<UUID> agentGroups = new List<UUID>(); | 299 | if (!sp.ControllingClient.IsGroupMember(LandData.GroupID)) |
299 | if (groupsModule != null) | 300 | return false; |
300 | { | 301 | |
301 | GroupMembershipData[] GroupMembership = | 302 | return true; |
302 | groupsModule.GetMembershipData(avatar); | ||
303 | |||
304 | if (GroupMembership != null) | ||
305 | { | ||
306 | for (int i = 0; i < GroupMembership.Length; i++) | ||
307 | { | ||
308 | if (LandData.GroupID == GroupMembership[i].GroupID) | ||
309 | { | ||
310 | return true; | ||
311 | } | ||
312 | } | ||
313 | } | ||
314 | } | ||
315 | } | 303 | } |
316 | return false; | 304 | return false; |
317 | } | 305 | } |