diff options
author | Melanie | 2012-03-08 18:31:58 +0100 |
---|---|---|
committer | Melanie | 2012-03-08 19:14:34 +0000 |
commit | 675d40357c2ba0bf2d268cc35874dabe7dbb724d (patch) | |
tree | 0aa6feb1b9628acf710ecdeee9697720c69e6762 /OpenSim/Region | |
parent | Move "change region" command into general category (diff) | |
download | opensim-SC_OLD-675d40357c2ba0bf2d268cc35874dabe7dbb724d.zip opensim-SC_OLD-675d40357c2ba0bf2d268cc35874dabe7dbb724d.tar.gz opensim-SC_OLD-675d40357c2ba0bf2d268cc35874dabe7dbb724d.tar.bz2 opensim-SC_OLD-675d40357c2ba0bf2d268cc35874dabe7dbb724d.tar.xz |
Hold a ref to the prim we're sat on rather than querying scene each time
the check for significant is carried out. Prevents a deadlock condition.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ec6bb89..9d5cdfa 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -457,15 +457,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
457 | // without the parent rotation applied. | 457 | // without the parent rotation applied. |
458 | if (ParentID != 0) | 458 | if (ParentID != 0) |
459 | { | 459 | { |
460 | SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID); | 460 | SceneObjectPart part = ParentPart; |
461 | if (part != null) | 461 | return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); |
462 | { | ||
463 | return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); | ||
464 | } | ||
465 | else | ||
466 | { | ||
467 | return ParentPosition + m_pos; | ||
468 | } | ||
469 | } | 462 | } |
470 | } | 463 | } |
471 | return m_pos; | 464 | return m_pos; |
@@ -576,6 +569,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
576 | } | 569 | } |
577 | private uint m_parentID; | 570 | private uint m_parentID; |
578 | 571 | ||
572 | public SceneObjectPart ParentPart | ||
573 | { | ||
574 | get { return m_parentPart; } | ||
575 | set { m_parentPart = value; } | ||
576 | } | ||
577 | private SceneObjectPart m_parentPart = null; | ||
578 | |||
579 | public float Health | 579 | public float Health |
580 | { | 580 | { |
581 | get { return m_health; } | 581 | get { return m_health; } |
@@ -1751,36 +1751,34 @@ namespace OpenSim.Region.Framework.Scenes | |||
1751 | 1751 | ||
1752 | if (ParentID != 0) | 1752 | if (ParentID != 0) |
1753 | { | 1753 | { |
1754 | SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID); | 1754 | SceneObjectPart part = ParentPart; |
1755 | if (part != null) | 1755 | TaskInventoryDictionary taskIDict = part.TaskInventory; |
1756 | if (taskIDict != null) | ||
1756 | { | 1757 | { |
1757 | TaskInventoryDictionary taskIDict = part.TaskInventory; | 1758 | lock (taskIDict) |
1758 | if (taskIDict != null) | ||
1759 | { | 1759 | { |
1760 | lock (taskIDict) | 1760 | foreach (UUID taskID in taskIDict.Keys) |
1761 | { | 1761 | { |
1762 | foreach (UUID taskID in taskIDict.Keys) | 1762 | UnRegisterControlEventsToScript(LocalId, taskID); |
1763 | { | 1763 | taskIDict[taskID].PermsMask &= ~( |
1764 | UnRegisterControlEventsToScript(LocalId, taskID); | 1764 | 2048 | //PERMISSION_CONTROL_CAMERA |
1765 | taskIDict[taskID].PermsMask &= ~( | 1765 | 4); // PERMISSION_TAKE_CONTROLS |
1766 | 2048 | //PERMISSION_CONTROL_CAMERA | ||
1767 | 4); // PERMISSION_TAKE_CONTROLS | ||
1768 | } | ||
1769 | } | 1766 | } |
1770 | } | 1767 | } |
1768 | } | ||
1771 | 1769 | ||
1772 | // Reset sit target. | 1770 | // Reset sit target. |
1773 | if (part.SitTargetAvatar == UUID) | 1771 | if (part.SitTargetAvatar == UUID) |
1774 | part.SitTargetAvatar = UUID.Zero; | 1772 | part.SitTargetAvatar = UUID.Zero; |
1775 | 1773 | ||
1776 | ParentPosition = part.GetWorldPosition(); | 1774 | ParentPosition = part.GetWorldPosition(); |
1777 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); | 1775 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); |
1778 | } | ||
1779 | 1776 | ||
1780 | m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); | 1777 | m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); |
1781 | ParentPosition = Vector3.Zero; | 1778 | ParentPosition = Vector3.Zero; |
1782 | 1779 | ||
1783 | ParentID = 0; | 1780 | ParentID = 0; |
1781 | ParentPart = null; | ||
1784 | SendAvatarDataToAllAgents(); | 1782 | SendAvatarDataToAllAgents(); |
1785 | m_requestedSitTargetID = 0; | 1783 | m_requestedSitTargetID = 0; |
1786 | 1784 | ||
@@ -2212,6 +2210,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2212 | return; | 2210 | return; |
2213 | } | 2211 | } |
2214 | 2212 | ||
2213 | ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); | ||
2214 | if (ParentPart == null) | ||
2215 | return; | ||
2216 | |||
2215 | ParentID = m_requestedSitTargetID; | 2217 | ParentID = m_requestedSitTargetID; |
2216 | 2218 | ||
2217 | Velocity = Vector3.Zero; | 2219 | Velocity = Vector3.Zero; |