add osGetPrimCount([key primKey]) and osGetSittingAvatarsCount([key primkey]) that just do want name says unlike ll mess, absent primKey argument means current linkset

This commit is contained in:
UbitUmarov
2023-06-14 22:45:37 +01:00
parent 97b9f64e6d
commit 2849e57920
3 changed files with 63 additions and 0 deletions

View File

@@ -6153,5 +6153,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return result;
}
public LSL_Integer osGetPrimCount()
{
return m_host.ParentGroup.PrimCount;
}
public LSL_Integer osGetPrimCount(LSL_Key object_id)
{
if (!UUID.TryParse(object_id, out UUID id) || id.IsZero())
return 0;
SceneObjectPart part = World.GetSceneObjectPart(id);
if (part is null)
return 0;
return part.ParentGroup.PrimCount;
}
public LSL_Integer osGetSittingAvatarsCount()
{
return m_host.ParentGroup.GetSittingAvatarsCount();
}
public LSL_Integer osGetSittingAvatarsCount(LSL_Key object_id)
{
if (!UUID.TryParse(object_id, out UUID id) || id.IsZero())
return 0;
SceneObjectPart part = World.GetSceneObjectPart(id);
if (part is null)
return 0;
return part.ParentGroup.GetSittingAvatarsCount();
}
}
}