add LSL_Integer osAvatarType(LSL_Key avkey)

This commit is contained in:
UbitUmarov
2021-04-21 15:52:09 +01:00
parent 1b9a77f08d
commit 9d1bd02d12
6 changed files with 31 additions and 0 deletions

View File

@@ -71,6 +71,8 @@ using PrimType = OpenSim.Region.Framework.Scenes.PrimType;
using RegionFlags = OpenSim.Framework.RegionFlags;
using RegionInfo = OpenSim.Framework.RegionInfo;
#pragma warning disable IDE1006
namespace OpenSim.Region.ScriptEngine.Shared.Api
{
/// <summary>

View File

@@ -59,6 +59,8 @@ using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
using PermissionMask = OpenSim.Framework.PermissionMask;
using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
#pragma warning disable IDE1006
namespace OpenSim.Region.ScriptEngine.Shared.Api
{
//////////////////////////////////////////////////////////////
@@ -6126,5 +6128,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 0;
}
public LSL_Integer osAvatarType(LSL_Key avkey)
{
if (!UUID.TryParse(avkey.m_string, out UUID avId))
return -1;
ScenePresence av = World.GetScenePresence(avId);
if(av == null || av.IsDeleted)
return 0;
return av.IsNPC ? 2 : 1;
}
}
}