Allow group lookup during tp / login to make restricting parcels to group

work.
avinationmerge
Melanie 2010-11-25 21:22:22 +01:00
parent ee9aca9c52
commit 33c023bf6a
1 changed files with 15 additions and 0 deletions

View File

@ -294,7 +294,22 @@ namespace OpenSim.Region.CoreModules.World.Land
{
ScenePresence sp;
if (!m_scene.TryGetScenePresence(avatar, out sp))
{
IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
if (groupsModule == null)
return false;
GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar);
if (membership == null || membership.Length == 0)
return false;
foreach (GroupMembershipData d in membership)
{
if (d.GroupID == LandData.GroupID)
return true;
}
return false;
}
if (!sp.ControllingClient.IsGroupMember(LandData.GroupID))
return false;