diff options
author | Justin Clark-Casey (justincc) | 2012-07-10 23:50:04 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-10 23:50:04 +0100 |
commit | cdea572d2ea0256423a4cd72f132346d88a93e92 (patch) | |
tree | 67de79604fb75f0963171d36151c24be7c0fd654 /OpenSim/Region | |
parent | Revert "refactor: Add SOP.IsSitTargetOccupied to improve readability" (diff) | |
download | opensim-SC_OLD-cdea572d2ea0256423a4cd72f132346d88a93e92.zip opensim-SC_OLD-cdea572d2ea0256423a4cd72f132346d88a93e92.tar.gz opensim-SC_OLD-cdea572d2ea0256423a4cd72f132346d88a93e92.tar.bz2 opensim-SC_OLD-cdea572d2ea0256423a4cd72f132346d88a93e92.tar.xz |
refactor: move management of SOP.SitTargetAvatar into SOP.AddSittingAvatar() and SOP.RemoveSittingAvatar()
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index dcec7e9..b3f11a7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4525,6 +4525,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4525 | /// <param name='avatarId'></param> | 4525 | /// <param name='avatarId'></param> |
4526 | protected internal bool AddSittingAvatar(UUID avatarId) | 4526 | protected internal bool AddSittingAvatar(UUID avatarId) |
4527 | { | 4527 | { |
4528 | if (IsSitTargetSet && SitTargetAvatar == UUID.Zero) | ||
4529 | SitTargetAvatar = avatarId; | ||
4530 | |||
4528 | HashSet<UUID> sittingAvatars = m_sittingAvatars; | 4531 | HashSet<UUID> sittingAvatars = m_sittingAvatars; |
4529 | 4532 | ||
4530 | if (sittingAvatars == null) | 4533 | if (sittingAvatars == null) |
@@ -4547,6 +4550,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4547 | /// <param name='avatarId'></param> | 4550 | /// <param name='avatarId'></param> |
4548 | protected internal bool RemoveSittingAvatar(UUID avatarId) | 4551 | protected internal bool RemoveSittingAvatar(UUID avatarId) |
4549 | { | 4552 | { |
4553 | if (SitTargetAvatar == avatarId) | ||
4554 | SitTargetAvatar = UUID.Zero; | ||
4555 | |||
4550 | HashSet<UUID> sittingAvatars = m_sittingAvatars; | 4556 | HashSet<UUID> sittingAvatars = m_sittingAvatars; |
4551 | 4557 | ||
4552 | // This can occur under a race condition where another thread | 4558 | // This can occur under a race condition where another thread |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a8c98ed..514c314 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1799,10 +1799,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1799 | } | 1799 | } |
1800 | } | 1800 | } |
1801 | 1801 | ||
1802 | // Reset sit target. | ||
1803 | if (part.SitTargetAvatar == UUID) | ||
1804 | part.SitTargetAvatar = UUID.Zero; | ||
1805 | |||
1806 | ParentPosition = part.GetWorldPosition(); | 1802 | ParentPosition = part.GetWorldPosition(); |
1807 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); | 1803 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); |
1808 | 1804 | ||
@@ -1884,7 +1880,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1884 | // "[SCENE PRESENCE]: Sitting {0} on {1} {2} because sit target is set and unoccupied", | 1880 | // "[SCENE PRESENCE]: Sitting {0} on {1} {2} because sit target is set and unoccupied", |
1885 | // Name, part.Name, part.LocalId); | 1881 | // Name, part.Name, part.LocalId); |
1886 | 1882 | ||
1887 | part.SitTargetAvatar = UUID; | ||
1888 | offset = part.SitTargetPosition; | 1883 | offset = part.SitTargetPosition; |
1889 | sitOrientation = part.SitTargetOrientation; | 1884 | sitOrientation = part.SitTargetOrientation; |
1890 | canSit = true; | 1885 | canSit = true; |