diff options
author | Melanie | 2012-09-28 00:15:58 +0200 |
---|---|---|
committer | Melanie | 2012-09-28 00:15:58 +0200 |
commit | f05ca1a0fecee157daa8072ffda7e372cfaf81d8 (patch) | |
tree | e49fdbc0ecfe7ca83f549d82d6ce4434ddafea26 /OpenSim/Region/ScriptEngine | |
parent | Fix a possible NRE (diff) | |
parent | make some forgotten changes be done by simulation thread not by caller (diff) | |
download | opensim-SC-f05ca1a0fecee157daa8072ffda7e372cfaf81d8.zip opensim-SC-f05ca1a0fecee157daa8072ffda7e372cfaf81d8.tar.gz opensim-SC-f05ca1a0fecee157daa8072ffda7e372cfaf81d8.tar.bz2 opensim-SC-f05ca1a0fecee157daa8072ffda7e372cfaf81d8.tar.xz |
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 40 |
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; |