From 6bcdc82a465d8471e1aab66077ce5aaa944f78f6 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 17 Sep 2008 13:14:07 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=2206 * Fix/implement LSL group-related functions llDetectedGroup, llSameGroup * Thanks nlin --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 4219854..20b52b7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4553,8 +4553,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llSameGroup(string agent) { m_host.AddScriptLPS(1); - NotImplemented("llSameGroup"); - return 0; + UUID agentId = new UUID(); + 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) -- cgit v1.1