change ossl link sound functions to search for sound both on script host and target prims

This commit is contained in:
UbitUmarov
2018-11-14 19:02:00 +00:00
parent afb1d6cdd7
commit fad6295398
2 changed files with 43 additions and 23 deletions

View File

@@ -4900,7 +4900,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(sop == null)
return;
sop.AdjustSoundGain(volume);
ScriptSleep(100);
}
public void osSetSoundRadius(LSL_Integer linknum, LSL_Float radius)
@@ -4909,7 +4908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
SceneObjectPart sop = GetSingleLinkPart(linknum);
if(sop == null)
return;
m_host.SoundRadius = radius;
sop.SoundRadius = radius;
}
public void osPlaySound(LSL_Integer linknum, LSL_String sound, LSL_Float volume)
@@ -4923,8 +4922,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(sop == null)
return;
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, sound, AssetType.Sound);
if(soundID == UUID.Zero)
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, m_host, sound, AssetType.Sound);
if (soundID == UUID.Zero)
return;
// send the sound, once, to all clients in range
@@ -4942,8 +4941,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(sop == null)
return;
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, sound, AssetType.Sound);
if(soundID == UUID.Zero)
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, m_host, sound, AssetType.Sound);
if (soundID == UUID.Zero)
return;
m_SoundModule.LoopSound(sop.UUID, soundID, volume, false,false);
@@ -4953,12 +4952,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
if (m_SoundModule == null)
return;
SceneObjectPart sop = GetSingleLinkPart(linknum);
if(sop == null)
return;
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, sound, AssetType.Sound);
if(soundID == UUID.Zero)
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, m_host, sound, AssetType.Sound);
if (soundID == UUID.Zero)
return;
m_SoundModule.LoopSound(sop.UUID, soundID, volume, true, false);
@@ -4975,8 +4977,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(sop == null)
return;
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, sound, AssetType.Sound);
if(soundID == UUID.Zero)
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, m_host, sound, AssetType.Sound);
if (soundID == UUID.Zero)
return;
m_SoundModule.LoopSound(sop.UUID, soundID, volume, false, true);
@@ -4993,8 +4995,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(sop == null)
return;
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, sound, AssetType.Sound);
if(soundID == UUID.Zero)
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, m_host, sound, AssetType.Sound);
if (soundID == UUID.Zero)
return;
// send the sound, once, to all clients in range
@@ -5012,8 +5014,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(sop == null)
return;
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, sound, AssetType.Sound);
if(soundID == UUID.Zero)
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, m_host, sound, AssetType.Sound);
if (soundID == UUID.Zero)
return;
// send the sound, once, to all clients in rangeTrigger or play an attached sound in this part's inventory.
@@ -5032,8 +5034,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(sop == null)
return;
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, sound, AssetType.Sound);
if(soundID == UUID.Zero)
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, m_host, sound, AssetType.Sound);
if (soundID == UUID.Zero)
return;
m_SoundModule.TriggerSoundLimited(sop.UUID, soundID, volume,
@@ -5065,8 +5067,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(sop == null)
return;
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, sound, AssetType.Sound);
if(soundID == UUID.Zero)
UUID soundID = ScriptUtils.GetAssetIdFromKeyOrItemName(sop, m_host, sound, AssetType.Sound);
if (soundID == UUID.Zero)
return;
m_SoundModule.PreloadSound(sop.UUID, soundID);