swapping GetSceneObjectPart for TryGetSceneObjectPart in PlayAttachedSound to imply why we're doing an early return.

integration
SignpostMarv 2012-10-05 14:30:51 +01:00 committed by Justin Clark-Casey (justincc)
parent 1d47bcb6b6
commit 516ee244b4
1 changed files with 4 additions and 4 deletions

View File

@ -106,8 +106,8 @@ namespace OpenSim.Region.CoreModules.World.Sound
public virtual void PlayAttachedSound( public virtual void PlayAttachedSound(
UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius) UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius)
{ {
SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); SceneObjectPart part;
if (part == null) if (!m_scene.TryGetSceneObjectPart(objectID, out part))
return; return;
SceneObjectGroup grp = part.ParentGroup; SceneObjectGroup grp = part.ParentGroup;
@ -141,8 +141,8 @@ namespace OpenSim.Region.CoreModules.World.Sound
public virtual void TriggerSound( public virtual void TriggerSound(
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius) UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
{ {
SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); SceneObjectPart part;
if (part == null) if (!m_scene.TryGetSceneObjectPart(objectID, out part))
{ {
ScenePresence sp; ScenePresence sp;
if (!m_scene.TryGetScenePresence(objectID, out sp)) if (!m_scene.TryGetScenePresence(objectID, out sp))