aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs48
1 files changed, 29 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a8aa551..870bd66 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Region.Framework.Scenes
69 public ScriptControlled eventControls; 69 public ScriptControlled eventControls;
70 } 70 }
71 71
72 public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs); 72 public delegate void SendCoarseLocationsMethod(UUID scene, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs);
73 73
74 public class ScenePresence : EntityBase, IScenePresence 74 public class ScenePresence : EntityBase, IScenePresence
75 { 75 {
@@ -188,7 +188,7 @@ namespace OpenSim.Region.Framework.Scenes
188 /// </summary> 188 /// </summary>
189 public bool SitGround { get; private set; } 189 public bool SitGround { get; private set; }
190 190
191 private SendCourseLocationsMethod m_sendCourseLocationsMethod; 191 private SendCoarseLocationsMethod m_sendCoarseLocationsMethod;
192 192
193 //private Vector3 m_requestedSitOffset = new Vector3(); 193 //private Vector3 m_requestedSitOffset = new Vector3();
194 194
@@ -711,7 +711,7 @@ namespace OpenSim.Region.Framework.Scenes
711 AttachmentsSyncLock = new Object(); 711 AttachmentsSyncLock = new Object();
712 AllowMovement = true; 712 AllowMovement = true;
713 IsChildAgent = true; 713 IsChildAgent = true;
714 m_sendCourseLocationsMethod = SendCoarseLocationsDefault; 714 m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
715 Animator = new ScenePresenceAnimator(this); 715 Animator = new ScenePresenceAnimator(this);
716 PresenceType = type; 716 PresenceType = type;
717 DrawDistance = world.DefaultDrawDistance; 717 DrawDistance = world.DefaultDrawDistance;
@@ -974,7 +974,9 @@ namespace OpenSim.Region.Framework.Scenes
974 { 974 {
975 if (wasChild && HasAttachments()) 975 if (wasChild && HasAttachments())
976 { 976 {
977 m_log.DebugFormat("[SCENE PRESENCE]: Restarting scripts in attachments..."); 977 m_log.DebugFormat(
978 "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
979
978 // Resume scripts 980 // Resume scripts
979 Util.FireAndForget(delegate(object x) { 981 Util.FireAndForget(delegate(object x) {
980 foreach (SceneObjectGroup sog in m_attachments) 982 foreach (SceneObjectGroup sog in m_attachments)
@@ -1530,17 +1532,22 @@ namespace OpenSim.Region.Framework.Scenes
1530 bool DCFlagKeyPressed = false; 1532 bool DCFlagKeyPressed = false;
1531 Vector3 agent_control_v3 = Vector3.Zero; 1533 Vector3 agent_control_v3 = Vector3.Zero;
1532 1534
1533 bool oldflying = Flying; 1535 bool newFlying = actor.Flying;
1534 1536
1535 if (ForceFly) 1537 if (ForceFly)
1536 actor.Flying = true; 1538 newFlying = true;
1537 else if (FlyDisabled) 1539 else if (FlyDisabled)
1538 actor.Flying = false; 1540 newFlying = false;
1539 else 1541 else
1540 actor.Flying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); 1542 newFlying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
1541 1543
1542 if (actor.Flying != oldflying) 1544 if (actor.Flying != newFlying)
1545 {
1546 // Note: ScenePresence.Flying is actually fetched from the physical actor
1547 // so setting PhysActor.Flying here also sets the ScenePresence's value.
1548 actor.Flying = newFlying;
1543 update_movementflag = true; 1549 update_movementflag = true;
1550 }
1544 1551
1545 if (ParentID == 0) 1552 if (ParentID == 0)
1546 { 1553 {
@@ -2622,17 +2629,17 @@ namespace OpenSim.Region.Framework.Scenes
2622 2629
2623 public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) 2630 public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
2624 { 2631 {
2625 SendCourseLocationsMethod d = m_sendCourseLocationsMethod; 2632 SendCoarseLocationsMethod d = m_sendCoarseLocationsMethod;
2626 if (d != null) 2633 if (d != null)
2627 { 2634 {
2628 d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs); 2635 d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs);
2629 } 2636 }
2630 } 2637 }
2631 2638
2632 public void SetSendCourseLocationMethod(SendCourseLocationsMethod d) 2639 public void SetSendCoarseLocationMethod(SendCoarseLocationsMethod d)
2633 { 2640 {
2634 if (d != null) 2641 if (d != null)
2635 m_sendCourseLocationsMethod = d; 2642 m_sendCoarseLocationsMethod = d;
2636 } 2643 }
2637 2644
2638 public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) 2645 public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
@@ -2836,7 +2843,7 @@ namespace OpenSim.Region.Framework.Scenes
2836 #region Significant Movement Method 2843 #region Significant Movement Method
2837 2844
2838 /// <summary> 2845 /// <summary>
2839 /// This checks for a significant movement and sends a courselocationchange update 2846 /// This checks for a significant movement and sends a coarselocationchange update
2840 /// </summary> 2847 /// </summary>
2841 protected void CheckForSignificantMovement() 2848 protected void CheckForSignificantMovement()
2842 { 2849 {
@@ -3268,7 +3275,7 @@ namespace OpenSim.Region.Framework.Scenes
3268 cAgent.Anims = Animator.Animations.ToArray(); 3275 cAgent.Anims = Animator.Animations.ToArray();
3269 } 3276 }
3270 catch { } 3277 catch { }
3271 cAgent.DefaultAnim = Animator.Animations.DefaultAnimation; 3278 cAgent.DefaultAnim = Animator.Animations.ImplicitDefaultAnimation;
3272 3279
3273 if (Scene.AttachmentsModule != null) 3280 if (Scene.AttachmentsModule != null)
3274 Scene.AttachmentsModule.CopyAttachments(this, cAgent); 3281 Scene.AttachmentsModule.CopyAttachments(this, cAgent);
@@ -3627,13 +3634,16 @@ namespace OpenSim.Region.Framework.Scenes
3627 public List<SceneObjectGroup> GetAttachments(uint attachmentPoint) 3634 public List<SceneObjectGroup> GetAttachments(uint attachmentPoint)
3628 { 3635 {
3629 List<SceneObjectGroup> attachments = new List<SceneObjectGroup>(); 3636 List<SceneObjectGroup> attachments = new List<SceneObjectGroup>();
3630 3637
3631 lock (m_attachments) 3638 if (attachmentPoint >= 0)
3632 { 3639 {
3633 foreach (SceneObjectGroup so in m_attachments) 3640 lock (m_attachments)
3634 { 3641 {
3635 if (attachmentPoint == so.AttachmentPoint) 3642 foreach (SceneObjectGroup so in m_attachments)
3636 attachments.Add(so); 3643 {
3644 if (attachmentPoint == so.AttachmentPoint)
3645 attachments.Add(so);
3646 }
3637 } 3647 }
3638 } 3648 }
3639 3649