From 67bdbc02a1b1c4693b0f3a8819d2d50b2b192902 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 1 Jan 2022 18:32:54 +0000 Subject: [PATCH] change osMessageAttachments() a bit more --- .../Shared/Api/Implementation/OSSL_Api.cs | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 2870e3c9da..78674343e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -4349,6 +4349,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; if (target.IsDeleted || target.IsInTransit) return; + if(target.GetAttachmentsCount() == 0) + return; bool invertPoints = (options & ScriptBaseClass.OS_ATTACH_MSG_INVERT_POINTS) != 0; bool msgAll = false; @@ -4368,47 +4370,36 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api msgAll = true; break; } - else + else if(ipoint > 0) aps.Add(ipoint); } } else - { - if (!invertPoints) - return; aps = new List(); - } if(aps.Count == 0) { + if (!invertPoints && !msgAll) + return; msgAll = true; invertPoints = false; } - if (msgAll && invertPoints) - return; - - List attachments = new List(); + List attachments; if (msgAll || invertPoints) { attachments = target.GetAttachments(); } else { + attachments = new List(); foreach (int point in aps) - { - if (point > 0) - { - attachments.AddRange(target.GetAttachments((uint)point)); - } - } + attachments.AddRange(target.GetAttachments((uint)point)); } // if we have no attachments at this point, exit now if (attachments.Count == 0) - { return; - } bool optionObjCreator = (options & ScriptBaseClass.OS_ATTACH_MSG_OBJECT_CREATOR) != 0; bool optionScriptCreator = (options & ScriptBaseClass.OS_ATTACH_MSG_SCRIPT_CREATOR) != 0;