diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0252145..c479944 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2370,28 +2370,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2370 | m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, false, false); | 2370 | m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, false, false); |
2371 | } | 2371 | } |
2372 | 2372 | ||
2373 | // Xantor 20080528 we should do this differently. | ||
2374 | // 1) apply the sound to the object | ||
2375 | // 2) schedule full update | ||
2376 | // just sending the sound out once doesn't work so well when other avatars come in view later on | ||
2377 | // or when the prim gets moved, changed, sat on, whatever | ||
2378 | // see large number of mantises (mantes?) | ||
2379 | // 20080530 Updated to remove code duplication | ||
2380 | // 20080530 Stop sound if there is one, otherwise volume only changes don't work | ||
2381 | public void llLoopSound(string sound, double volume) | 2373 | public void llLoopSound(string sound, double volume) |
2382 | { | 2374 | { |
2383 | m_host.AddScriptLPS(1); | 2375 | m_host.AddScriptLPS(1); |
2384 | 2376 | if (m_SoundModule != null) | |
2385 | if (m_host.Sound != UUID.Zero) | 2377 | { |
2386 | llStopSound(); | 2378 | m_SoundModule.LoopSound(m_host.UUID, KeyOrName(sound), |
2387 | 2379 | volume, 20, false); | |
2388 | m_host.Sound = KeyOrName(sound); | 2380 | } |
2389 | m_host.SoundGain = volume; | ||
2390 | m_host.SoundFlags = 1; // looping | ||
2391 | m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? | ||
2392 | |||
2393 | m_host.ScheduleFullUpdate(); | ||
2394 | m_host.SendFullUpdateToAllClients(); | ||
2395 | } | 2381 | } |
2396 | 2382 | ||
2397 | public void llLoopSoundMaster(string sound, double volume) | 2383 | public void llLoopSoundMaster(string sound, double volume) |
@@ -2399,8 +2385,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2399 | m_host.AddScriptLPS(1); | 2385 | m_host.AddScriptLPS(1); |
2400 | if (m_SoundModule != null) | 2386 | if (m_SoundModule != null) |
2401 | { | 2387 | { |
2402 | m_SoundModule.LoopSoundMaster(m_host.UUID, KeyOrName(sound), | 2388 | m_SoundModule.LoopSound(m_host.UUID, KeyOrName(sound), |
2403 | volume, 20); | 2389 | volume, 20, true); |
2404 | } | 2390 | } |
2405 | } | 2391 | } |
2406 | 2392 | ||