diff options
author | UbitUmarov | 2017-11-14 03:49:32 +0000 |
---|---|---|
committer | UbitUmarov | 2017-11-14 03:49:32 +0000 |
commit | 873d42005fed47ba6e7c9bc2184e33f496ff9ce7 (patch) | |
tree | 371fd9125ac885adae4231a7f081101ffafcf267 | |
parent | Changing map tile colors This change also allows setting the water color, as ... (diff) | |
download | opensim-SC_OLD-873d42005fed47ba6e7c9bc2184e33f496ff9ce7.zip opensim-SC_OLD-873d42005fed47ba6e7c9bc2184e33f496ff9ce7.tar.gz opensim-SC_OLD-873d42005fed47ba6e7c9bc2184e33f496ff9ce7.tar.bz2 opensim-SC_OLD-873d42005fed47ba6e7c9bc2184e33f496ff9ce7.tar.xz |
add AGENT_LIST_EXCLUDENPC bit mask option to llGetAgentList scope to exclude NPCs
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fa32986..d36d9a0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -6639,11 +6639,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6639 | /// AGENT_LIST_PARCEL - all in the same parcel as the scripted object | 6639 | /// AGENT_LIST_PARCEL - all in the same parcel as the scripted object |
6640 | /// AGENT_LIST_PARCEL_OWNER - all in any parcel owned by the owner of the | 6640 | /// AGENT_LIST_PARCEL_OWNER - all in any parcel owned by the owner of the |
6641 | /// current parcel. | 6641 | /// current parcel. |
6642 | /// AGENT_LIST_EXCLUDENPC ignore NPCs (bit mask) | ||
6642 | /// </summary> | 6643 | /// </summary> |
6643 | public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options) | 6644 | public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options) |
6644 | { | 6645 | { |
6645 | m_host.AddScriptLPS(1); | 6646 | m_host.AddScriptLPS(1); |
6646 | 6647 | ||
6648 | // do our bit masks part | ||
6649 | bool noNPC = (scope & ScriptBaseClass.AGENT_LIST_EXCLUDENPC) !=0; | ||
6650 | |||
6651 | // remove bit masks part | ||
6652 | scope &= ~ ScriptBaseClass.AGENT_LIST_EXCLUDENPC; | ||
6653 | |||
6647 | // the constants are 1, 2 and 4 so bits are being set, but you | 6654 | // the constants are 1, 2 and 4 so bits are being set, but you |
6648 | // get an error "INVALID_SCOPE" if it is anything but 1, 2 and 4 | 6655 | // get an error "INVALID_SCOPE" if it is anything but 1, 2 and 4 |
6649 | bool regionWide = scope == ScriptBaseClass.AGENT_LIST_REGION; | 6656 | bool regionWide = scope == ScriptBaseClass.AGENT_LIST_REGION; |
@@ -6684,6 +6691,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6684 | World.ForEachRootScenePresence( | 6691 | World.ForEachRootScenePresence( |
6685 | delegate (ScenePresence ssp) | 6692 | delegate (ScenePresence ssp) |
6686 | { | 6693 | { |
6694 | if(noNPC && ssp.IsNPC) | ||
6695 | return; | ||
6696 | |||
6687 | // Gods are not listed in SL | 6697 | // Gods are not listed in SL |
6688 | if (!ssp.IsDeleted && !ssp.IsViewerUIGod && !ssp.IsChildAgent) | 6698 | if (!ssp.IsDeleted && !ssp.IsViewerUIGod && !ssp.IsChildAgent) |
6689 | { | 6699 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index e4c1ca0..2f249a7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -660,6 +660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
660 | public const int AGENT_LIST_PARCEL = 1; | 660 | public const int AGENT_LIST_PARCEL = 1; |
661 | public const int AGENT_LIST_PARCEL_OWNER = 2; | 661 | public const int AGENT_LIST_PARCEL_OWNER = 2; |
662 | public const int AGENT_LIST_REGION = 4; | 662 | public const int AGENT_LIST_REGION = 4; |
663 | public const int AGENT_LIST_EXCLUDENPC = 0x4000000; // our flag, not SL and it is a bit mask | ||
663 | 664 | ||
664 | // Can not be public const? | 665 | // Can not be public const? |
665 | public static readonly vector ZERO_VECTOR = new vector(0.0, 0.0, 0.0); | 666 | public static readonly vector ZERO_VECTOR = new vector(0.0, 0.0, 0.0); |