diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9feed38dfe..4acfc762cf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2116,11 +2116,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface; texface = tex.GetFace((uint)face); - return texface.TextureID.ToString(); + string texture = texface.TextureID.ToString(); + + lock (part.TaskInventory) + { + foreach (KeyValuePair inv in part.TaskInventory) + { + if (inv.Value.AssetID == texface.TextureID) + { + texture = inv.Value.Name.ToString(); + break; + } + } + } + + return texture; } else {