From 5876a4d392f4f1742325c65e52e7201e0f43108b Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Jun 2012 00:24:07 +0200 Subject: Prevent a null ref when getting the velocity of an avatar during login or logout. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') 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 { m_host.AddScriptLPS(1); - Vector3 vel; + Vector3 vel = Vector3.Zero; if (m_host.ParentGroup.IsAttachment) { ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); - vel = avatar.Velocity; + if (avatar != null) + vel = avatar.Velocity; } else { -- cgit v1.1 From 91557f18cd796e64158d2e3dbdef28d0b3927d1b Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Jun 2012 17:59:20 +0200 Subject: Set collision sound type so custom sound types are recognized --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a51c625..37738a5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4812,6 +4812,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.CollisionSoundVolume = (float)impact_volume; m_host.CollisionSound = m_host.invalidCollisionSoundUUID; + m_host,CollisionSoundType = 0; return; } // TODO: Parameter check logic required. @@ -4831,6 +4832,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } m_host.CollisionSoundVolume = (float)impact_volume; m_host.CollisionSound = soundId; + m_host.CollisionSoundType = 1; } public LSL_String llGetAnimation(string id) -- cgit v1.1 From 31bc9c3ad34d280d7be89dae20ecb9486b5065bb Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Jun 2012 18:04:09 +0200 Subject: Typo correction --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 37738a5..667aa93 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4812,7 +4812,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.CollisionSoundVolume = (float)impact_volume; m_host.CollisionSound = m_host.invalidCollisionSoundUUID; - m_host,CollisionSoundType = 0; + m_host.CollisionSoundType = 0; return; } // TODO: Parameter check logic required. -- cgit v1.1