diff options
author | SignpostMarv | 2012-10-05 14:39:06 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-10-29 23:38:58 +0000 |
commit | 32db725dd770a52d02f86cf8a1274f68178d6844 (patch) | |
tree | eca13c8f11c6e1fb86af4f59d2d433476da3a6f0 /OpenSim/Region/Framework | |
parent | Changing the logic order in the TaskInventory iterator of ScenObjectPart.Send... (diff) | |
download | opensim-SC_OLD-32db725dd770a52d02f86cf8a1274f68178d6844.zip opensim-SC_OLD-32db725dd770a52d02f86cf8a1274f68178d6844.tar.gz opensim-SC_OLD-32db725dd770a52d02f86cf8a1274f68178d6844.tar.bz2 opensim-SC_OLD-32db725dd770a52d02f86cf8a1274f68178d6844.tar.xz |
SceneObjectPart.SendSound can exit early if a sound module was not found.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 681feea..3a39da0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2684,6 +2684,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2684 | /// <param name="flags"></param> | 2684 | /// <param name="flags"></param> |
2685 | public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster) | 2685 | public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster) |
2686 | { | 2686 | { |
2687 | ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>(); | ||
2688 | if(soundModule == null) | ||
2689 | return; | ||
2690 | |||
2687 | volume = Util.Clip((float)volume, 0, 1); | 2691 | volume = Util.Clip((float)volume, 0, 1); |
2688 | 2692 | ||
2689 | UUID ownerID = OwnerID; | 2693 | UUID ownerID = OwnerID; |
@@ -2713,9 +2717,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2713 | if (soundID == UUID.Zero) | 2717 | if (soundID == UUID.Zero) |
2714 | return; | 2718 | return; |
2715 | 2719 | ||
2716 | ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>(); | ||
2717 | if (soundModule != null) | ||
2718 | { | ||
2719 | if (useMaster) | 2720 | if (useMaster) |
2720 | { | 2721 | { |
2721 | if (isMaster) | 2722 | if (isMaster) |
@@ -2761,7 +2762,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2761 | else | 2762 | else |
2762 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | 2763 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); |
2763 | } | 2764 | } |
2764 | } | ||
2765 | } | 2765 | } |
2766 | 2766 | ||
2767 | /// <summary> | 2767 | /// <summary> |