From 44c56a974c428379ebf82386aac7b7443fd82a7d Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 19 Nov 2008 18:30:16 +0000 Subject: Mantis#2656. Thank you kindly, Nlin for a patch that: Attached patch implements llCollisionSound. Thanks T. Sado. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 968581b..a06ed9b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3490,7 +3490,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionSound(string impact_sound, double impact_volume) { m_host.AddScriptLPS(1); - NotImplemented("llCollisionSound"); + //NotImplemented("llCollisionSound"); + + // TODO: Parameter check logic required. + UUID soundId = UUID.Zero; + if (!UUID.TryParse(impact_sound, out soundId)) + { + foreach (TaskInventoryItem item in m_host.TaskInventory.Values) + { + if (item.Type == (int)AssetType.Sound && item.Name == impact_sound) + { + soundId = item.AssetID; + break; + } + } + } + m_host.CollisionSound = soundId; + m_host.CollisionSoundVolume = (float)impact_volume; } public void llCollisionSprite(string impact_sprite) -- cgit v1.1