refactor: In llCollisionSound() use existing GetInventoryItem() method rather than have it iterate through TaskInventory itself.
parent
9a0bcb7750
commit
3436be2046
|
@ -4121,18 +4121,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID soundId = UUID.Zero;
|
UUID soundId = UUID.Zero;
|
||||||
if (!UUID.TryParse(impact_sound, out soundId))
|
if (!UUID.TryParse(impact_sound, out soundId))
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(impact_sound);
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
if (item != null && item.Type == (int)AssetType.Sound)
|
||||||
{
|
soundId = item.AssetID;
|
||||||
if (item.Type == (int)AssetType.Sound && item.Name == impact_sound)
|
|
||||||
{
|
|
||||||
soundId = item.AssetID;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_host.CollisionSound = soundId;
|
m_host.CollisionSound = soundId;
|
||||||
m_host.CollisionSoundVolume = (float)impact_volume;
|
m_host.CollisionSoundVolume = (float)impact_volume;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue