aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorMelanie2012-09-27 17:29:44 +0100
committerMelanie2012-09-27 17:29:44 +0100
commit001ec0e2e6f8c426af8f4a1c1eb9be4db066aea4 (patch)
tree11170fddbd0f4c71c6f8288b5848442dfdc90d76 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentRemove a core undo call that we don't need. (diff)
parentMerge branch 'ubitwork' into avination (diff)
downloadopensim-SC-001ec0e2e6f8c426af8f4a1c1eb9be4db066aea4.zip
opensim-SC-001ec0e2e6f8c426af8f4a1c1eb9be4db066aea4.tar.gz
opensim-SC-001ec0e2e6f8c426af8f4a1c1eb9be4db066aea4.tar.bz2
opensim-SC-001ec0e2e6f8c426af8f4a1c1eb9be4db066aea4.tar.xz
Merge branch 'avination' into careminster
Conflicts: OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-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 8d06d83..f0d378d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -10149,31 +10149,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10149 UUID key = new UUID(); 10149 UUID key = new UUID();
10150 if (UUID.TryParse(id, out key)) 10150 if (UUID.TryParse(id, out key))
10151 { 10151 {
10152 try 10152 // return total object mass
10153 { 10153 SceneObjectPart part = World.GetSceneObjectPart(key);
10154 /* 10154 if (part != null)
10155 SceneObjectPart obj = World.GetSceneObjectPart(World.Entities[key].LocalId); 10155 return part.ParentGroup.GetMass();
10156 if (obj != null)
10157 return (double)obj.GetMass();
10158 */
10159 // return total object mass
10160 SceneObjectGroup obj = World.GetGroupByPrim(World.Entities[key].LocalId);
10161 if (obj != null)
10162 return obj.GetMass();
10163 10156
10164 // the object is null so the key is for an avatar 10157 // the object is null so the key is for an avatar
10165 ScenePresence avatar = World.GetScenePresence(key); 10158 ScenePresence avatar = World.GetScenePresence(key);
10166 if (avatar != null) 10159 if (avatar != null)
10167 if (avatar.IsChildAgent)
10168 // reference http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetObjectMass
10169 // child agents have a mass of 1.0
10170 return 1;
10171 else
10172 return (double)avatar.GetMass();
10173 }
10174 catch (KeyNotFoundException)
10175 { 10160 {
10176 return 0; // The Object/Agent not in the region so just return zero 10161 if (avatar.IsChildAgent)
10162 {
10163 // reference http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetObjectMass
10164 // child agents have a mass of 1.0
10165 return 1;
10166 }
10167 else
10168 {
10169 return (double)avatar.GetMass();
10170 }
10177 } 10171 }
10178 } 10172 }
10179 return 0; 10173 return 0;