From 656ea163cc4f90a9fcac8aedc3f5ba41410ea236 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 20 Oct 2019 10:55:13 +0100 Subject: a few changes on LlGetObjectDetails --- .../Shared/Api/Implementation/LSL_Api.cs | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 302c431..8ddd175 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -14511,19 +14511,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ret.Add(new LSL_Integer(count)); break; case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: - List invAttachments = av.GetAttachments(); - int invcount = 0; + if (Attachments == null) + Attachments = av.GetAttachments(); + count = 0; try { - foreach (SceneObjectGroup Attachment in invAttachments) + foreach (SceneObjectGroup Attachment in Attachments) { SceneObjectPart[] parts = Attachment.Parts; int nparts = parts.Count(); for(int i = 0; i < nparts; i++) - invcount += parts[i].Inventory.Count; + count += parts[i].Inventory.Count; } } catch { }; - ret.Add(new LSL_Integer(invcount)); + ret.Add(new LSL_Integer(count)); break; case ScriptBaseClass.OBJECT_REZZER_KEY: ret.Add(new LSL_Key((string)id)); @@ -14534,14 +14535,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.OBJECT_TEMP_ATTACHED: ret.Add(new LSL_Integer(0)); break; + case ScriptBaseClass.OBJECT_ATTACHED_SLOTS_AVAILABLE: + if (Attachments == null) + Attachments = av.GetAttachments(); + ret.Add(new LSL_Integer(38 - Attachments.Count)); + break; case ScriptBaseClass.OBJECT_CREATION_TIME: ret.Add(new LSL_String("")); break; case ScriptBaseClass.OBJECT_SELECT_COUNT: - ret.Add(new LSL_String("")); + ret.Add(new LSL_Integer(0)); break; case ScriptBaseClass.OBJECT_SIT_COUNT: - ret.Add(new LSL_String("")); + ret.Add(new LSL_Integer(0)); break; case ScriptBaseClass.OBJECT_ANIMATED_COUNT: count = 0; @@ -14773,9 +14779,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: SceneObjectPart[] parts = obj.ParentGroup.Parts; - int nparts = parts.Count(); count = 0; - for(int i = 0; i < nparts; i++) + for(int i = 0; i < parts.Count(); i++) count += parts[i].Inventory.Count; ret.Add(new LSL_Integer(count)); break; @@ -14795,6 +14800,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ret.Add(new LSL_Integer(0)); } break; + case ScriptBaseClass.OBJECT_ATTACHED_SLOTS_AVAILABLE: + ret.Add(new LSL_Integer(0)); + break; case ScriptBaseClass.OBJECT_CREATION_TIME: DateTime date = Util.ToDateTime(m_host.ParentGroup.RootPart.CreationDate); ret.Add(new LSL_String(date.ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture))); -- cgit v1.1