mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Fix a regression to GetSittingAvatars(). Return List<ScenePresence> once more.
This commit is contained in:
@@ -1419,7 +1419,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <value>
|
||||
/// null if there are no sitting avatars. This is to save us create a hashset for every prim in a scene.
|
||||
/// </value>
|
||||
private HashSet<UUID> m_sittingAvatars;
|
||||
private HashSet<ScenePresence> m_sittingAvatars;
|
||||
|
||||
public virtual UUID RegionID
|
||||
{
|
||||
@@ -2212,7 +2212,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Array.Copy(Shape.ExtraParams, extraP, extraP.Length);
|
||||
dupe.Shape.ExtraParams = extraP;
|
||||
|
||||
dupe.m_sittingAvatars = new HashSet<UUID>();
|
||||
dupe.m_sittingAvatars = new HashSet<ScenePresence>();
|
||||
|
||||
// safeguard actual copy is done in sog.copy
|
||||
dupe.KeyframeMotion = null;
|
||||
@@ -5543,19 +5543,19 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||
/// true if the avatar was not already recorded, false otherwise.
|
||||
/// </returns>
|
||||
/// <param name='avatarId'></param>
|
||||
protected internal bool AddSittingAvatar(UUID id)
|
||||
protected internal bool AddSittingAvatar(ScenePresence sp)
|
||||
{
|
||||
lock (ParentGroup.m_sittingAvatars)
|
||||
{
|
||||
if (IsSitTargetSet && SitTargetAvatar == UUID.Zero)
|
||||
SitTargetAvatar = id;
|
||||
SitTargetAvatar = sp.UUID;
|
||||
|
||||
if (m_sittingAvatars == null)
|
||||
m_sittingAvatars = new HashSet<UUID>();
|
||||
m_sittingAvatars = new HashSet<ScenePresence>();
|
||||
|
||||
if (m_sittingAvatars.Add(id))
|
||||
if (m_sittingAvatars.Add(sp))
|
||||
{
|
||||
ParentGroup.m_sittingAvatars.Add(id);
|
||||
ParentGroup.m_sittingAvatars.Add(sp);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -5572,22 +5572,22 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||
/// true if the avatar was present and removed, false if it was not present.
|
||||
/// </returns>
|
||||
/// <param name='avatarId'></param>
|
||||
protected internal bool RemoveSittingAvatar(UUID id)
|
||||
protected internal bool RemoveSittingAvatar(ScenePresence sp)
|
||||
{
|
||||
lock (ParentGroup.m_sittingAvatars)
|
||||
{
|
||||
if (SitTargetAvatar == id)
|
||||
if (SitTargetAvatar == sp.UUID)
|
||||
SitTargetAvatar = UUID.Zero;
|
||||
|
||||
if (m_sittingAvatars == null)
|
||||
return false;
|
||||
|
||||
if (m_sittingAvatars.Remove(id))
|
||||
if (m_sittingAvatars.Remove(sp))
|
||||
{
|
||||
if (m_sittingAvatars.Count == 0)
|
||||
m_sittingAvatars = null;
|
||||
|
||||
ParentGroup.m_sittingAvatars.Remove(id);
|
||||
ParentGroup.m_sittingAvatars.Remove(sp);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -5601,14 +5601,14 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||
/// </summary>
|
||||
/// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks>
|
||||
/// <returns>A hashset of the sitting avatars. Returns null if there are no sitting avatars.</returns>
|
||||
public HashSet<UUID> GetSittingAvatars()
|
||||
public HashSet<ScenePresence> GetSittingAvatars()
|
||||
{
|
||||
lock (ParentGroup.m_sittingAvatars)
|
||||
{
|
||||
if (m_sittingAvatars == null)
|
||||
return null;
|
||||
else
|
||||
return new HashSet<UUID>(m_sittingAvatars);
|
||||
return new HashSet<ScenePresence>(m_sittingAvatars);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user