From 627efc172bda961f888dd3191fd8e1c4885f46e3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 6 Apr 2012 20:32:39 +0100 Subject: Make llGetMass() return total mass of object when called on root prim. As per http://lslwiki.net/lslwiki/wakka.php?wakka=llGetMass Aims to resolve http://opensimulator.org/mantis/view.php?id=5954 --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8d25a62..43b66f4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2907,7 +2907,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llGetMass() { m_host.AddScriptLPS(1); - return m_host.GetMass(); + if (m_host.IsRoot) + return m_host.ParentGroup.GetMass(); + else + return m_host.GetMass(); } public void llCollisionFilter(string name, string id, int accept) -- cgit v1.1