diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 47 |
1 files changed, 25 insertions, 22 deletions
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 | |||
424 | { | 424 | { |
425 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) | 425 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) |
426 | { | 426 | { |
427 | bool isMember; | 427 | ScenePresence sp; |
428 | if (m_groupMemberCache.TryGetValue(avatar, out isMember)) | 428 | if (!m_scene.TryGetScenePresence(avatar, out sp)) |
429 | return isMember; | ||
430 | |||
431 | IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); | ||
432 | if (groupsModule == null) | ||
433 | { | 429 | { |
434 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | 430 | bool isMember; |
435 | return false; | 431 | if (m_groupMemberCache.TryGetValue(avatar, out isMember)) |
436 | } | 432 | return isMember; |
437 | 433 | ||
438 | GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar); | 434 | IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); |
439 | if (membership == null || membership.Length == 0) | 435 | if (groupsModule == null) |
440 | { | 436 | return false; |
441 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | ||
442 | return false; | ||
443 | } | ||
444 | 437 | ||
445 | foreach (GroupMembershipData d in membership) | 438 | GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar); |
446 | { | 439 | if (membership == null || membership.Length == 0) |
447 | if (d.GroupID == LandData.GroupID) | ||
448 | { | 440 | { |
449 | m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout); | 441 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); |
450 | return true; | 442 | return false; |
451 | } | 443 | } |
444 | |||
445 | foreach (GroupMembershipData d in membership) | ||
446 | { | ||
447 | if (d.GroupID == LandData.GroupID) | ||
448 | { | ||
449 | m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout); | ||
450 | return true; | ||
451 | } | ||
452 | } | ||
453 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | ||
454 | return false; | ||
452 | } | 455 | } |
453 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | 456 | |
454 | return false; | 457 | return sp.ControllingClient.IsGroupMember(LandData.GroupID); |
455 | } | 458 | } |
456 | return false; | 459 | return false; |
457 | } | 460 | } |