mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
add LSL_Integer osAvatarType(LSL_Key avkey)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user