From e53f4399812224939e4ebec6790a9addb38cca95 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Jun 2017 20:42:49 +0100 Subject: add osGetNPCList() --- .../Shared/Api/Implementation/OSSL_Api.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 823a4e5..fa7ee21 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3835,6 +3835,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return result; } + public LSL_List osGetNPCList() + { + CheckThreatLevel(ThreatLevel.None, "osGetNPCList"); + m_host.AddScriptLPS(1); + + LSL_List result = new LSL_List(); + World.ForEachRootScenePresence(delegate (ScenePresence avatar) + { + if (avatar != null && avatar.IsNPC) + { + result.Add(new LSL_String(avatar.UUID.ToString())); + result.Add(new LSL_Vector(avatar.AbsolutePosition)); + result.Add(new LSL_String(avatar.Name)); + } + }); + + return result; + } + /// /// Convert a unix time to a llGetTimestamp() like string /// -- cgit v1.1