diff options
author | Justin Clark-Casey (justincc) | 2012-07-04 21:15:00 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-04 21:15:00 +0100 |
commit | 3717812ce090cae850449ed82463545c079df68d (patch) | |
tree | 5ccf15897aaa297647964eb85b375d5620b205e0 /OpenSim/Region | |
parent | refactor: In llRemoveInventory() use existing GetInventoryItem() method rathe... (diff) | |
download | opensim-SC_OLD-3717812ce090cae850449ed82463545c079df68d.zip opensim-SC_OLD-3717812ce090cae850449ed82463545c079df68d.tar.gz opensim-SC_OLD-3717812ce090cae850449ed82463545c079df68d.tar.bz2 opensim-SC_OLD-3717812ce090cae850449ed82463545c079df68d.tar.xz |
refactor: In llCollisionSound() use existing GetInventoryItem() method rather than have it iterate through TaskInventory itself.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b52ebac..ff4b690 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4290,18 +4290,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4290 | UUID soundId = UUID.Zero; | 4290 | UUID soundId = UUID.Zero; |
4291 | if (!UUID.TryParse(impact_sound, out soundId)) | 4291 | if (!UUID.TryParse(impact_sound, out soundId)) |
4292 | { | 4292 | { |
4293 | lock (m_host.TaskInventory) | 4293 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(impact_sound); |
4294 | { | 4294 | |
4295 | foreach (TaskInventoryItem item in m_host.TaskInventory.Values) | 4295 | if (item != null && item.Type == (int)AssetType.Sound) |
4296 | { | 4296 | soundId = item.AssetID; |
4297 | if (item.Type == (int)AssetType.Sound && item.Name == impact_sound) | ||
4298 | { | ||
4299 | soundId = item.AssetID; | ||
4300 | break; | ||
4301 | } | ||
4302 | } | ||
4303 | } | ||
4304 | } | 4297 | } |
4298 | |||
4305 | m_host.CollisionSound = soundId; | 4299 | m_host.CollisionSound = soundId; |
4306 | m_host.CollisionSoundVolume = (float)impact_volume; | 4300 | m_host.CollisionSoundVolume = (float)impact_volume; |
4307 | } | 4301 | } |