diff options
author | Melanie | 2012-03-08 18:31:58 +0100 |
---|---|---|
committer | Melanie | 2012-03-08 18:31:58 +0100 |
commit | b8c27252c1c65cab64cff4e143c70be6441099c9 (patch) | |
tree | 56a7a9f77db475caa03128a6fafa3b6efc84fb95 | |
parent | changes on undo/redo (untested/incomplete). Think we may consider moving thi... (diff) | |
download | opensim-SC-b8c27252c1c65cab64cff4e143c70be6441099c9.zip opensim-SC-b8c27252c1c65cab64cff4e143c70be6441099c9.tar.gz opensim-SC-b8c27252c1c65cab64cff4e143c70be6441099c9.tar.bz2 opensim-SC-b8c27252c1c65cab64cff4e143c70be6441099c9.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.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 26fa6c0..8a7c06a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -527,15 +527,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
527 | // without the parent rotation applied. | 527 | // without the parent rotation applied. |
528 | if (ParentID != 0) | 528 | if (ParentID != 0) |
529 | { | 529 | { |
530 | SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID); | 530 | SceneObjectPart part = ParentPart; |
531 | if (part != null) | ||
532 | { | ||
533 | return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); | 531 | return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); |
534 | } | ||
535 | else | ||
536 | { | ||
537 | return ParentPosition + m_pos; | ||
538 | } | ||
539 | } | 532 | } |
540 | } | 533 | } |
541 | return m_pos; | 534 | return m_pos; |
@@ -653,6 +646,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
653 | } | 646 | } |
654 | private UUID m_parentUUID = UUID.Zero; | 647 | private UUID m_parentUUID = UUID.Zero; |
655 | 648 | ||
649 | public SceneObjectPart ParentPart | ||
650 | { | ||
651 | get { return m_parentPart; } | ||
652 | set { m_parentPart = value; } | ||
653 | } | ||
654 | private SceneObjectPart m_parentPart = null; | ||
655 | |||
656 | public float Health | 656 | public float Health |
657 | { | 657 | { |
658 | get { return m_health; } | 658 | get { return m_health; } |
@@ -891,6 +891,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
891 | part.SitTargetAvatar = UUID; | 891 | part.SitTargetAvatar = UUID; |
892 | ParentPosition = part.GetWorldPosition(); | 892 | ParentPosition = part.GetWorldPosition(); |
893 | ParentID = part.LocalId; | 893 | ParentID = part.LocalId; |
894 | ParentPart = part; | ||
894 | m_pos = m_prevSitOffset; | 895 | m_pos = m_prevSitOffset; |
895 | pos = ParentPosition; | 896 | pos = ParentPosition; |
896 | } | 897 | } |
@@ -1865,37 +1866,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
1865 | 1866 | ||
1866 | if (ParentID != 0) | 1867 | if (ParentID != 0) |
1867 | { | 1868 | { |
1868 | SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID); | 1869 | SceneObjectPart part = ParentPart; |
1869 | if (part != null) | 1870 | TaskInventoryDictionary taskIDict = part.TaskInventory; |
1871 | if (taskIDict != null) | ||
1870 | { | 1872 | { |
1871 | TaskInventoryDictionary taskIDict = part.TaskInventory; | 1873 | lock (taskIDict) |
1872 | if (taskIDict != null) | ||
1873 | { | 1874 | { |
1874 | lock (taskIDict) | 1875 | foreach (UUID taskID in taskIDict.Keys) |
1875 | { | 1876 | { |
1876 | foreach (UUID taskID in taskIDict.Keys) | 1877 | UnRegisterControlEventsToScript(LocalId, taskID); |
1877 | { | 1878 | taskIDict[taskID].PermsMask &= ~( |
1878 | UnRegisterControlEventsToScript(LocalId, taskID); | 1879 | 2048 | //PERMISSION_CONTROL_CAMERA |
1879 | taskIDict[taskID].PermsMask &= ~( | 1880 | 4); // PERMISSION_TAKE_CONTROLS |
1880 | 2048 | //PERMISSION_CONTROL_CAMERA | ||
1881 | 4); // PERMISSION_TAKE_CONTROLS | ||
1882 | } | ||
1883 | } | 1881 | } |
1884 | } | 1882 | } |
1883 | } | ||
1885 | 1884 | ||
1886 | // Reset sit target. | 1885 | // Reset sit target. |
1887 | if (part.SitTargetAvatar == UUID) | 1886 | if (part.SitTargetAvatar == UUID) |
1888 | part.SitTargetAvatar = UUID.Zero; | 1887 | part.SitTargetAvatar = UUID.Zero; |
1889 | 1888 | ||
1890 | part.ParentGroup.DeleteAvatar(UUID); | 1889 | part.ParentGroup.DeleteAvatar(UUID); |
1891 | ParentPosition = part.GetWorldPosition(); | 1890 | ParentPosition = part.GetWorldPosition(); |
1892 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); | 1891 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); |
1893 | } | ||
1894 | 1892 | ||
1895 | m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); | 1893 | m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); |
1896 | ParentPosition = Vector3.Zero; | 1894 | ParentPosition = Vector3.Zero; |
1897 | 1895 | ||
1898 | ParentID = 0; | 1896 | ParentID = 0; |
1897 | ParentPart = null; | ||
1899 | 1898 | ||
1900 | if (PhysicsActor == null) | 1899 | if (PhysicsActor == null) |
1901 | AddToPhysicalScene(false); | 1900 | AddToPhysicalScene(false); |
@@ -2356,6 +2355,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2356 | return; | 2355 | return; |
2357 | } | 2356 | } |
2358 | 2357 | ||
2358 | ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); | ||
2359 | if (ParentPart == null) | ||
2360 | return; | ||
2361 | |||
2359 | ParentID = m_requestedSitTargetID; | 2362 | ParentID = m_requestedSitTargetID; |
2360 | 2363 | ||
2361 | Velocity = Vector3.Zero; | 2364 | Velocity = Vector3.Zero; |