aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorubit2012-09-28 00:16:22 +0200
committerubit2012-09-28 00:16:22 +0200
commitacdbe6e9dd2789c92878f12bd5983dd6ff9d73a8 (patch)
treef0ae56e7d141380470c7d769e8097734baff7921 /OpenSim/Region/ScriptEngine/Shared/Api
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parentmake some forgotten changes be done by simulation thread not by caller (diff)
downloadopensim-SC-acdbe6e9dd2789c92878f12bd5983dd6ff9d73a8.zip
opensim-SC-acdbe6e9dd2789c92878f12bd5983dd6ff9d73a8.tar.gz
opensim-SC-acdbe6e9dd2789c92878f12bd5983dd6ff9d73a8.tar.bz2
opensim-SC-acdbe6e9dd2789c92878f12bd5983dd6ff9d73a8.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs40
1 files changed, 17 insertions, 23 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index f9b4bfd..05aaebf 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -10599,31 +10599,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10599 UUID key = new UUID(); 10599 UUID key = new UUID();
10600 if (UUID.TryParse(id, out key)) 10600 if (UUID.TryParse(id, out key))
10601 { 10601 {
10602 try 10602 // return total object mass
10603 { 10603 SceneObjectPart part = World.GetSceneObjectPart(key);
10604 /* 10604 if (part != null)
10605 SceneObjectPart obj = World.GetSceneObjectPart(World.Entities[key].LocalId); 10605 return part.ParentGroup.GetMass();
10606 if (obj != null)
10607 return (double)obj.GetMass();
10608 */
10609 // return total object mass
10610 SceneObjectGroup obj = World.GetGroupByPrim(World.Entities[key].LocalId);
10611 if (obj != null)
10612 return obj.GetMass();
10613 10606
10614 // the object is null so the key is for an avatar 10607 // the object is null so the key is for an avatar
10615 ScenePresence avatar = World.GetScenePresence(key); 10608 ScenePresence avatar = World.GetScenePresence(key);
10616 if (avatar != null) 10609 if (avatar != null)
10617 if (avatar.IsChildAgent)
10618 // reference http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetObjectMass
10619 // child agents have a mass of 1.0
10620 return 1;
10621 else
10622 return (double)avatar.GetMass();
10623 }
10624 catch (KeyNotFoundException)
10625 { 10610 {
10626 return 0; // The Object/Agent not in the region so just return zero 10611 if (avatar.IsChildAgent)
10612 {
10613 // reference http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetObjectMass
10614 // child agents have a mass of 1.0
10615 return 1;
10616 }
10617 else
10618 {
10619 return (double)avatar.GetMass();
10620 }
10627 } 10621 }
10628 } 10622 }
10629 return 0; 10623 return 0;