aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-10-04 00:07:52 +0100
committerJustin Clark-Casey (justincc)2011-10-04 00:07:52 +0100
commit8a6e6866d9c6c60e4a2e4b980ca2e35ae3963d0d (patch)
treee3d8e45c4b640ca01759e69aec949e7fd04e3fe4 /OpenSim/Region/ScriptEngine
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-8a6e6866d9c6c60e4a2e4b980ca2e35ae3963d0d.zip
opensim-SC_OLD-8a6e6866d9c6c60e4a2e4b980ca2e35ae3963d0d.tar.gz
opensim-SC_OLD-8a6e6866d9c6c60e4a2e4b980ca2e35ae3963d0d.tar.bz2
opensim-SC_OLD-8a6e6866d9c6c60e4a2e4b980ca2e35ae3963d0d.tar.xz
For llGetTexture(), if the face texture asset is in the inventory, return the inventory name rather than the asset UUID
This is as per http://wiki.secondlife.com/wiki/LlGetTexture Applied patch in http://opensimulator.org/mantis/view.php?id=4552 with an additional break statement if an inventory item is found to exit early. Thanks Michelle Argus!
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 9a26f4b..8291105 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1912,11 +1912,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1912 { 1912 {
1913 face = 0; 1913 face = 0;
1914 } 1914 }
1915
1915 if (face >= 0 && face < GetNumberOfSides(part)) 1916 if (face >= 0 && face < GetNumberOfSides(part))
1916 { 1917 {
1917 Primitive.TextureEntryFace texface; 1918 Primitive.TextureEntryFace texface;
1918 texface = tex.GetFace((uint)face); 1919 texface = tex.GetFace((uint)face);
1919 return texface.TextureID.ToString(); 1920 string texture = texface.TextureID.ToString();
1921
1922 lock (part.TaskInventory)
1923 {
1924 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in part.TaskInventory)
1925 {
1926 if (inv.Value.AssetID == texface.TextureID)
1927 {
1928 texture = inv.Value.Name.ToString();
1929 break;
1930 }
1931 }
1932 }
1933
1934 return texture;
1920 } 1935 }
1921 else 1936 else
1922 { 1937 {