add AGENT_LIST_EXCLUDENPC bit mask option to llGetAgentList scope to exclude NPCs

This commit is contained in:
UbitUmarov
2017-11-14 03:49:32 +00:00
parent 98f90f4eed
commit 873d42005f
2 changed files with 11 additions and 0 deletions

View File

@@ -6639,11 +6639,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// AGENT_LIST_PARCEL - all in the same parcel as the scripted object
/// AGENT_LIST_PARCEL_OWNER - all in any parcel owned by the owner of the
/// current parcel.
/// AGENT_LIST_EXCLUDENPC ignore NPCs (bit mask)
/// </summary>
public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options)
{
m_host.AddScriptLPS(1);
// do our bit masks part
bool noNPC = (scope & ScriptBaseClass.AGENT_LIST_EXCLUDENPC) !=0;
// remove bit masks part
scope &= ~ ScriptBaseClass.AGENT_LIST_EXCLUDENPC;
// the constants are 1, 2 and 4 so bits are being set, but you
// get an error "INVALID_SCOPE" if it is anything but 1, 2 and 4
bool regionWide = scope == ScriptBaseClass.AGENT_LIST_REGION;
@@ -6684,6 +6691,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
World.ForEachRootScenePresence(
delegate (ScenePresence ssp)
{
if(noNPC && ssp.IsNPC)
return;
// Gods are not listed in SL
if (!ssp.IsDeleted && !ssp.IsViewerUIGod && !ssp.IsChildAgent)
{