mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
add AGENT_LIST_EXCLUDENPC bit mask option to llGetAgentList scope to exclude NPCs
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user