diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a046f29..a85a36e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2907,10 +2907,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2907 | public LSL_Float llGetMass() | 2907 | public LSL_Float llGetMass() |
2908 | { | 2908 | { |
2909 | m_host.AddScriptLPS(1); | 2909 | m_host.AddScriptLPS(1); |
2910 | if (m_host.IsRoot) | 2910 | |
2911 | return m_host.ParentGroup.GetMass(); | 2911 | if (m_host.ParentGroup.IsAttachment) |
2912 | { | ||
2913 | ScenePresence attachedAvatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar); | ||
2914 | |||
2915 | if (attachedAvatar != null) | ||
2916 | { | ||
2917 | return attachedAvatar.GetMass(); | ||
2918 | } | ||
2919 | else | ||
2920 | { | ||
2921 | return 0; | ||
2922 | } | ||
2923 | } | ||
2912 | else | 2924 | else |
2913 | return m_host.GetMass(); | 2925 | { |
2926 | if (m_host.IsRoot) | ||
2927 | { | ||
2928 | return m_host.ParentGroup.GetMass(); | ||
2929 | } | ||
2930 | else | ||
2931 | { | ||
2932 | return m_host.GetMass(); | ||
2933 | } | ||
2934 | } | ||
2914 | } | 2935 | } |
2915 | 2936 | ||
2916 | public void llCollisionFilter(string name, string id, int accept) | 2937 | public void llCollisionFilter(string name, string id, int accept) |