From 4917637ce618f8489111b465eaa1c9aa214d1649 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 18 Jul 2012 14:30:40 +0200 Subject: Fix llSameGroup to work according to specs --- .../Shared/Api/Implementation/LSL_Api.cs | 46 +++++++++++++++++----- 1 file changed, 36 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6ec3081..7cb4a26 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6371,22 +6371,48 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return agentSize; } - public LSL_Integer llSameGroup(string agent) + public LSL_Integer llSameGroup(string id) { m_host.AddScriptLPS(1); - UUID agentId = new UUID(); - if (!UUID.TryParse(agent, out agentId)) + UUID uuid = new UUID(); + if (!UUID.TryParse(id, out uuid)) return new LSL_Integer(0); - if (agentId == m_host.GroupID) + + // Check if it's a group key + if (uuid == m_host.ParentGroup.RootPart.GroupID) return new LSL_Integer(1); - ScenePresence presence = World.GetScenePresence(agentId); - if (presence == null || presence.IsChildAgent) // Return false for child agents + + // We got passed a UUID.Zero + if (uuid == UUID.Zero) return new LSL_Integer(0); - IClientAPI client = presence.ControllingClient; - if (m_host.GroupID == client.ActiveGroupId) - return new LSL_Integer(1); - else + + // Handle the case where id names an avatar + ScenePresence presence = World.GetScenePresence(uuid); + if (presence != null) + { + if (presence.IsChildAgent) + return new LSL_Integer(0); + + IClientAPI client = presence.ControllingClient; + if (m_host.ParentGroup.RootPart.GroupID == client.ActiveGroupId) + return new LSL_Integer(1); + return new LSL_Integer(0); + } + + // Handle object case + SceneObjectPart part = World.GetSceneObjectPart(uuid); + if (part != null) + { + // This will handle both deed and non-deed and also the no + // group case + if (part.ParentGroup.RootPart.GroupID == m_host.ParentGroup.RootPart.GroupID) + return new LSL_Integer(1); + + return new LSL_Integer(0); + } + + return new LSL_Integer(0); } public void llUnSit(string id) -- cgit v1.1 From 5b68bff73bffb7cdda88cb451f267a835b6d7f0b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 19 Jul 2012 11:10:23 +0100 Subject: kick git --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7cb4a26..94b1b34 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + using System; using System.Collections; using System.Collections.Generic; -- cgit v1.1 From 0facebec4076f682f79070e639905869161fd6b1 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 19 Jul 2012 11:12:53 +0100 Subject: Update ubitMesh primMesher with new Dahlia version on core ( reckick git back) --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 94b1b34..977f39e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -24,7 +24,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - using System; using System.Collections; -- cgit v1.1