aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-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 {