aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-15 23:36:32 +0100
committerJustin Clark-Casey (justincc)2011-07-15 23:36:32 +0100
commit0ee7a5ee81437f7fb81814b1694c00cb5a206bda (patch)
tree2c84ffd683ec926e18f0737156489c18eea659fa /OpenSim/Region/ScriptEngine/Shared/Api
parentminor: method doc for baked texture uploading (diff)
downloadopensim-SC-0ee7a5ee81437f7fb81814b1694c00cb5a206bda.zip
opensim-SC-0ee7a5ee81437f7fb81814b1694c00cb5a206bda.tar.gz
opensim-SC-0ee7a5ee81437f7fb81814b1694c00cb5a206bda.tar.bz2
opensim-SC-0ee7a5ee81437f7fb81814b1694c00cb5a206bda.tar.xz
If object is an attachment, make llGetVel() return the avatar's speed rather than the object's own zero speed.
As per http://opensimulator.org/mantis/view.php?id=5575
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c8bce60..7759b0a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2214,7 +2214,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2214 public LSL_Vector llGetVel() 2214 public LSL_Vector llGetVel()
2215 { 2215 {
2216 m_host.AddScriptLPS(1); 2216 m_host.AddScriptLPS(1);
2217 return new LSL_Vector(m_host.Velocity.X, m_host.Velocity.Y, m_host.Velocity.Z); 2217
2218 Vector3 vel;
2219
2220 if (m_host.IsAttachment)
2221 {
2222 ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.AttachedAvatar);
2223 vel = avatar.Velocity;
2224 }
2225 else
2226 {
2227 vel = m_host.Velocity;
2228 }
2229
2230 return new LSL_Vector(vel.X, vel.Y, vel.Z);
2218 } 2231 }
2219 2232
2220 public LSL_Vector llGetAccel() 2233 public LSL_Vector llGetAccel()
@@ -10021,8 +10034,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10021 break; 10034 break;
10022 } 10035 }
10023 } 10036 }
10037
10024 return ret; 10038 return ret;
10025 } 10039 }
10040
10026 SceneObjectPart obj = World.GetSceneObjectPart(key); 10041 SceneObjectPart obj = World.GetSceneObjectPart(key);
10027 if (obj != null) 10042 if (obj != null)
10028 { 10043 {