* Fix/implement LSL group-related functions llDetectedGroup, llSameGroup * Thanks nlin0.6.0-stable
parent
5c165c9bdd
commit
6bcdc82a46
|
@ -932,14 +932,17 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Types.LSLInteger llDetectedGroup(int number)
|
public LSL_Types.LSLInteger llDetectedGroup(int number)
|
||||||
{ //CFK: I *think* this is right, but am not sure.
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
EntityBase SensedObject = entityDetectedKey(number);
|
UUID SensedUUID = uuidDetectedKey(number);
|
||||||
if (SensedObject == null)
|
if (SensedUUID == UUID.Zero)
|
||||||
return new LSL_Types.LSLInteger(0);
|
return new LSL_Types.LSLInteger(0);
|
||||||
if (m_host.GroupID == m_host.ParentGroup.RootPart.GroupID)
|
ScenePresence presence = World.GetScenePresence(SensedUUID);
|
||||||
|
IClientAPI client = presence.ControllingClient;
|
||||||
|
if (m_host.GroupID == client.ActiveGroupId)
|
||||||
return new LSL_Types.LSLInteger(1);
|
return new LSL_Types.LSLInteger(1);
|
||||||
return new LSL_Types.LSLInteger(0);
|
else
|
||||||
|
return new LSL_Types.LSLInteger(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Types.LSLInteger llDetectedLinkNumber(int number)
|
public LSL_Types.LSLInteger llDetectedLinkNumber(int number)
|
||||||
|
@ -4708,8 +4711,17 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
public LSL_Types.LSLInteger llSameGroup(string agent)
|
public LSL_Types.LSLInteger llSameGroup(string agent)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
NotImplemented("llSameGroup");
|
UUID agentId = new UUID();
|
||||||
return 0;
|
if (!UUID.TryParse(agent, out agentId))
|
||||||
|
return new LSL_Types.LSLInteger(0);
|
||||||
|
ScenePresence presence = World.GetScenePresence(agentId);
|
||||||
|
if (presence == null)
|
||||||
|
return new LSL_Types.LSLInteger(0);
|
||||||
|
IClientAPI client = presence.ControllingClient;
|
||||||
|
if (m_host.GroupID == client.ActiveGroupId)
|
||||||
|
return new LSL_Types.LSLInteger(1);
|
||||||
|
else
|
||||||
|
return new LSL_Types.LSLInteger(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llUnSit(string id)
|
public void llUnSit(string id)
|
||||||
|
|
|
@ -4553,8 +4553,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public LSL_Types.LSLInteger llSameGroup(string agent)
|
public LSL_Types.LSLInteger llSameGroup(string agent)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
NotImplemented("llSameGroup");
|
UUID agentId = new UUID();
|
||||||
return 0;
|
if (!UUID.TryParse(agent, out agentId))
|
||||||
|
return new LSL_Types.LSLInteger(0);
|
||||||
|
ScenePresence presence = World.GetScenePresence(agentId);
|
||||||
|
if (presence == null)
|
||||||
|
return new LSL_Types.LSLInteger(0);
|
||||||
|
IClientAPI client = presence.ControllingClient;
|
||||||
|
if (m_host.GroupID == client.ActiveGroupId)
|
||||||
|
return new LSL_Types.LSLInteger(1);
|
||||||
|
else
|
||||||
|
return new LSL_Types.LSLInteger(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llUnSit(string id)
|
public void llUnSit(string id)
|
||||||
|
|
Loading…
Reference in New Issue