Trigger event with flag CHANGED_LINK when agent sits on objects that have not a sit target defined. This fixes Mantis #4692.

viewer-2-initial-appearance
Marck 2010-12-12 20:06:23 +01:00
parent 8ea4933742
commit 7f0350b988
2 changed files with 6 additions and 9 deletions

View File

@ -3251,13 +3251,6 @@ namespace OpenSim.Region.Framework.Scenes
//} //}
} }
public void SetAvatarOnSitTarget(UUID avatarID)
{
m_sitTargetAvatar = avatarID;
if (ParentGroup != null)
ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
}
public void SetAxisRotation(int axis, int rotate) public void SetAxisRotation(int axis, int rotate)
{ {
if (m_parentGroup != null) if (m_parentGroup != null)

View File

@ -1703,7 +1703,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
// Reset sit target. // Reset sit target.
if (part.GetAvatarOnSitTarget() == UUID) if (part.GetAvatarOnSitTarget() == UUID)
part.SetAvatarOnSitTarget(UUID.Zero); part.SitTargetAvatar = UUID.Zero;
if (part.ParentGroup != null)
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
m_parentPosition = part.GetWorldPosition(); m_parentPosition = part.GetWorldPosition();
ControllingClient.SendClearFollowCamProperties(part.ParentUUID); ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
@ -1807,11 +1809,13 @@ namespace OpenSim.Region.Framework.Scenes
if (SitTargetisSet && SitTargetUnOccupied) if (SitTargetisSet && SitTargetUnOccupied)
{ {
part.SetAvatarOnSitTarget(UUID); part.SitTargetAvatar = UUID;
offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z);
sitOrientation = avSitOrientation; sitOrientation = avSitOrientation;
autopilot = false; autopilot = false;
} }
if (part.ParentGroup != null)
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
pos = part.AbsolutePosition + offset; pos = part.AbsolutePosition + offset;
//if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1) //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1)