diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a8aa551..adb3d38 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -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 | { |
@@ -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 | ||