From 84b4158205db7b3d24ae7be97f7c509cb5e7429b Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Fri, 30 May 2008 16:37:17 +0000 Subject: Mantis#1422. Thank you kindly, Xantor for your llLoopSound() patch and I apologize for my confusion with the interim patch earlier. --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 5b1408f..e5167aa 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -1432,15 +1432,20 @@ namespace OpenSim.Region.ScriptEngine.Common // or when the prim gets moved, changed, sat on, whatever // see large number of mantises (mantes?) // 20080530 Updated to remove code duplication + // 20080530 Stop sound if there is one, otherwise volume only changes don't work public void llLoopSound(string sound, double volume) { m_host.AddScriptLPS(1); + if (m_host.Sound != LLUUID.Zero) + llStopSound(); + m_host.Sound = KeyOrName(sound); m_host.SoundGain = volume; m_host.SoundFlags = 1; // looping m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? + m_host.ScheduleFullUpdate(); m_host.SendFullUpdateToAllClients(); } @@ -1478,6 +1483,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.SoundFlags = 0; m_host.SoundRadius = 0; + m_host.ScheduleFullUpdate(); m_host.SendFullUpdateToAllClients(); // m_host.SendSound(LLUUID.Zero.ToString(), 1.0, false, 2); -- cgit v1.1