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,8 +294,23 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
ScenePresence sp; ScenePresence sp;
if (!m_scene.TryGetScenePresence(avatar, out sp)) if (!m_scene.TryGetScenePresence(avatar, out sp))
{
IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
if (groupsModule == null)
return false; 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)) if (!sp.ControllingClient.IsGroupMember(LandData.GroupID))
return false; return false;