aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorMelanie2012-03-08 19:09:11 +0000
committerMelanie2012-03-08 19:09:11 +0000
commit3089344114fec1c171f674223a0dd35b97115d04 (patch)
tree57b813fddbfb7c7ca79483fa6179a88f2871b85f /OpenSim/Region/Framework/Scenes/ScenePresence.cs
parentMerge branch 'master' into careminster (diff)
parentHold a ref to the prim we're sat on rather than querying scene each time (diff)
downloadopensim-SC_OLD-3089344114fec1c171f674223a0dd35b97115d04.zip
opensim-SC_OLD-3089344114fec1c171f674223a0dd35b97115d04.tar.gz
opensim-SC_OLD-3089344114fec1c171f674223a0dd35b97115d04.tar.bz2
opensim-SC_OLD-3089344114fec1c171f674223a0dd35b97115d04.tar.xz
Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs57
1 files changed, 30 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 2efb0d2..4190cf6 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -463,15 +463,8 @@ namespace OpenSim.Region.Framework.Scenes
463 // without the parent rotation applied. 463 // without the parent rotation applied.
464 if (ParentID != 0) 464 if (ParentID != 0)
465 { 465 {
466 SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID); 466 SceneObjectPart part = ParentPart;
467 if (part != null)
468 {
469 return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); 467 return part.AbsolutePosition + (m_pos * part.GetWorldRotation());
470 }
471 else
472 {
473 return ParentPosition + m_pos;
474 }
475 } 468 }
476 } 469 }
477 return m_pos; 470 return m_pos;
@@ -589,6 +582,13 @@ namespace OpenSim.Region.Framework.Scenes
589 } 582 }
590 private UUID m_parentUUID = UUID.Zero; 583 private UUID m_parentUUID = UUID.Zero;
591 584
585 public SceneObjectPart ParentPart
586 {
587 get { return m_parentPart; }
588 set { m_parentPart = value; }
589 }
590 private SceneObjectPart m_parentPart = null;
591
592 public float Health 592 public float Health
593 { 593 {
594 get { return m_health; } 594 get { return m_health; }
@@ -827,6 +827,7 @@ namespace OpenSim.Region.Framework.Scenes
827 part.SitTargetAvatar = UUID; 827 part.SitTargetAvatar = UUID;
828 ParentPosition = part.GetWorldPosition(); 828 ParentPosition = part.GetWorldPosition();
829 ParentID = part.LocalId; 829 ParentID = part.LocalId;
830 ParentPart = part;
830 m_pos = m_prevSitOffset; 831 m_pos = m_prevSitOffset;
831 pos = ParentPosition; 832 pos = ParentPosition;
832 } 833 }
@@ -1801,37 +1802,35 @@ namespace OpenSim.Region.Framework.Scenes
1801 1802
1802 if (ParentID != 0) 1803 if (ParentID != 0)
1803 { 1804 {
1804 SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID); 1805 SceneObjectPart part = ParentPart;
1805 if (part != null) 1806 TaskInventoryDictionary taskIDict = part.TaskInventory;
1807 if (taskIDict != null)
1806 { 1808 {
1807 TaskInventoryDictionary taskIDict = part.TaskInventory; 1809 lock (taskIDict)
1808 if (taskIDict != null)
1809 { 1810 {
1810 lock (taskIDict) 1811 foreach (UUID taskID in taskIDict.Keys)
1811 { 1812 {
1812 foreach (UUID taskID in taskIDict.Keys) 1813 UnRegisterControlEventsToScript(LocalId, taskID);
1813 { 1814 taskIDict[taskID].PermsMask &= ~(
1814 UnRegisterControlEventsToScript(LocalId, taskID); 1815 2048 | //PERMISSION_CONTROL_CAMERA
1815 taskIDict[taskID].PermsMask &= ~( 1816 4); // PERMISSION_TAKE_CONTROLS
1816 2048 | //PERMISSION_CONTROL_CAMERA
1817 4); // PERMISSION_TAKE_CONTROLS
1818 }
1819 } 1817 }
1820 } 1818 }
1819 }
1821 1820
1822 // Reset sit target. 1821 // Reset sit target.
1823 if (part.SitTargetAvatar == UUID) 1822 if (part.SitTargetAvatar == UUID)
1824 part.SitTargetAvatar = UUID.Zero; 1823 part.SitTargetAvatar = UUID.Zero;
1825 1824
1826 part.ParentGroup.DeleteAvatar(UUID); 1825 part.ParentGroup.DeleteAvatar(UUID);
1827 ParentPosition = part.GetWorldPosition(); 1826 ParentPosition = part.GetWorldPosition();
1828 ControllingClient.SendClearFollowCamProperties(part.ParentUUID); 1827 ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
1829 }
1830 1828
1831 m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); 1829 m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight);
1832 ParentPosition = Vector3.Zero; 1830 ParentPosition = Vector3.Zero;
1833 1831
1834 ParentID = 0; 1832 ParentID = 0;
1833 ParentPart = null;
1835 1834
1836 if (PhysicsActor == null) 1835 if (PhysicsActor == null)
1837 AddToPhysicalScene(false); 1836 AddToPhysicalScene(false);
@@ -2292,6 +2291,10 @@ namespace OpenSim.Region.Framework.Scenes
2292 return; 2291 return;
2293 } 2292 }
2294 2293
2294 ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
2295 if (ParentPart == null)
2296 return;
2297
2295 ParentID = m_requestedSitTargetID; 2298 ParentID = m_requestedSitTargetID;
2296 2299
2297 Velocity = Vector3.Zero; 2300 Velocity = Vector3.Zero;