diff options
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d83b05d..a51c625 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2536,12 +2536,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2536 | { | 2536 | { |
2537 | m_host.AddScriptLPS(1); | 2537 | m_host.AddScriptLPS(1); |
2538 | 2538 | ||
2539 | Vector3 vel; | 2539 | Vector3 vel = Vector3.Zero; |
2540 | 2540 | ||
2541 | if (m_host.ParentGroup.IsAttachment) | 2541 | if (m_host.ParentGroup.IsAttachment) |
2542 | { | 2542 | { |
2543 | ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); | 2543 | ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); |
2544 | vel = avatar.Velocity; | 2544 | if (avatar != null) |
2545 | vel = avatar.Velocity; | ||
2545 | } | 2546 | } |
2546 | else | 2547 | else |
2547 | { | 2548 | { |