diff options
author | Kevin Cozens | 2015-09-21 10:58:35 -0400 |
---|---|---|
committer | Kevin Cozens | 2015-09-21 11:00:34 -0400 |
commit | b412db72be9c7a3833550119ba4d1c04b995d188 (patch) | |
tree | 506ca226d36275d9e802249d1bf1f7cbeee6eee4 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation | |
parent | coment out lludp debug things that only fill up the help screen (diff) | |
download | opensim-SC-b412db72be9c7a3833550119ba4d1c04b995d188.zip opensim-SC-b412db72be9c7a3833550119ba4d1c04b995d188.tar.gz opensim-SC-b412db72be9c7a3833550119ba4d1c04b995d188.tar.bz2 opensim-SC-b412db72be9c7a3833550119ba4d1c04b995d188.tar.xz |
Fix a regression to GetSittingAvatars(). Return List<ScenePresence> once more.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 3f523a4..337e862 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -24,7 +24,7 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
@@ -617,7 +617,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
617 | } | 617 | } |
618 | 618 | ||
619 | int actualPrimCount = part.ParentGroup.PrimCount; | 619 | int actualPrimCount = part.ParentGroup.PrimCount; |
620 | List<UUID> sittingAvatars = part.ParentGroup.GetSittingAvatars(); | 620 | List<ScenePresence> sittingAvatars = part.ParentGroup.GetSittingAvatars(); |
621 | int adjustedPrimCount = actualPrimCount + sittingAvatars.Count; | 621 | int adjustedPrimCount = actualPrimCount + sittingAvatars.Count; |
622 | 622 | ||
623 | // Special case for a single prim. In this case the linknum is zero. However, this will not match a single | 623 | // Special case for a single prim. In this case the linknum is zero. However, this will not match a single |
@@ -646,11 +646,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
646 | } | 646 | } |
647 | else | 647 | else |
648 | { | 648 | { |
649 | ScenePresence sp = World.GetScenePresence(sittingAvatars[linknum - actualPrimCount - 1]); | 649 | return sittingAvatars[linknum - actualPrimCount - 1]; |
650 | if (sp != null) | ||
651 | return sp; | ||
652 | else | ||
653 | return null; | ||
654 | } | 650 | } |
655 | } | 651 | } |
656 | else | 652 | else |
@@ -4146,7 +4142,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4146 | } | 4142 | } |
4147 | else | 4143 | else |
4148 | { | 4144 | { |
4149 | if (m_host.ParentGroup.GetSittingAvatars().SingleOrDefault(id => id == agentID) != null) | 4145 | if (m_host.ParentGroup.GetSittingAvatars().SingleOrDefault(sp => sp.UUID == agentID) != null) |
4150 | { | 4146 | { |
4151 | // When agent is sitting, certain permissions are implicit if requested from sitting agent | 4147 | // When agent is sitting, certain permissions are implicit if requested from sitting agent |
4152 | implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | | 4148 | implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | |
@@ -6915,11 +6911,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6915 | if (UUID.TryParse(id, out key)) | 6911 | if (UUID.TryParse(id, out key)) |
6916 | { | 6912 | { |
6917 | ScenePresence av = World.GetScenePresence(key); | 6913 | ScenePresence av = World.GetScenePresence(key); |
6918 | List<UUID> sittingAvatars = m_host.ParentGroup.GetSittingAvatars(); | 6914 | List<ScenePresence> sittingAvatars = m_host.ParentGroup.GetSittingAvatars(); |
6919 | 6915 | ||
6920 | if (av != null) | 6916 | if (av != null) |
6921 | { | 6917 | { |
6922 | if (sittingAvatars.Contains(key)) | 6918 | if (sittingAvatars.Contains(av)) |
6923 | { | 6919 | { |
6924 | // if the avatar is sitting on this object, then | 6920 | // if the avatar is sitting on this object, then |
6925 | // we can unsit them. We don't want random scripts unsitting random people | 6921 | // we can unsit them. We don't want random scripts unsitting random people |
@@ -10316,9 +10312,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10316 | public LSL_Integer llGetNumberOfPrims() | 10312 | public LSL_Integer llGetNumberOfPrims() |
10317 | { | 10313 | { |
10318 | m_host.AddScriptLPS(1); | 10314 | m_host.AddScriptLPS(1); |
10319 | int avatarCount = m_host.ParentGroup.GetLinkedAvatars().Count; | 10315 | |
10320 | 10316 | return m_host.ParentGroup.PrimCount + m_host.ParentGroup.GetSittingAvatarsCount(); | |
10321 | return m_host.ParentGroup.PrimCount + avatarCount; | ||
10322 | } | 10317 | } |
10323 | 10318 | ||
10324 | /// <summary> | 10319 | /// <summary> |
@@ -14457,7 +14452,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
14457 | UUID userId = UUID.Zero; | 14452 | UUID userId = UUID.Zero; |
14458 | int msAvailable = 0; | 14453 | int msAvailable = 0; |
14459 | // Throttle per owner when attachment or "vehicle" (sat upon) | 14454 | // Throttle per owner when attachment or "vehicle" (sat upon) |
14460 | if (m_host.ParentGroup.IsAttachment || m_host.ParentGroup.GetSittingAvatars().Count > 0) | 14455 | if (m_host.ParentGroup.IsAttachment || m_host.ParentGroup.GetSittingAvatarsCount() > 0) |
14461 | { | 14456 | { |
14462 | userId = m_host.OwnerID; | 14457 | userId = m_host.OwnerID; |
14463 | msAvailable = m_msPerAvatarInCastRay; | 14458 | msAvailable = m_msPerAvatarInCastRay; |