From 3d8f59aac38e57cf573809b0456053aa0cc8500d Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 6 Oct 2012 22:40:26 +0100 Subject: refactoring StopSound into a private static method to skip repeating m_scene.TryGetSceneObjectPart --- OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs index 7ce13d1..b4b8e79 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs @@ -185,6 +185,11 @@ namespace OpenSim.Region.CoreModules.World.Sound if (!m_scene.TryGetSceneObjectPart(objectID, out m_host)) return; + StopSound(m_host); + } + + private static void StopSound(SceneObjectPart m_host) + { m_host.AdjustSoundGain(0); // Xantor 20080528: Clear prim data of sound instead if (m_host.ParentGroup.LoopSoundSlavePrims.Contains(m_host)) @@ -253,7 +258,7 @@ namespace OpenSim.Region.CoreModules.World.Sound m_host.ParentGroup.LoopSoundMasterPrim = m_host; if (m_host.Sound != UUID.Zero) - StopSound(objectID); + StopSound(m_host); m_host.Sound = soundID; m_host.SoundGain = volume; -- cgit v1.1