diff options
Merge branch 'master' into bulletsim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fc89473..4148d4b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -965,6 +965,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
965 | presence.Animator.SendAnimPackToClient(ControllingClient); | 965 | presence.Animator.SendAnimPackToClient(ControllingClient); |
966 | }); | 966 | }); |
967 | 967 | ||
968 | // If we don't reset the movement flag here, an avatar that crosses to a neighbouring sim and returns will | ||
969 | // stall on the border crossing since the existing child agent will still have the last movement | ||
970 | // recorded, which stops the input from being processed. | ||
971 | m_movementflag = 0; | ||
972 | |||
968 | m_scene.EventManager.TriggerOnMakeRootAgent(this); | 973 | m_scene.EventManager.TriggerOnMakeRootAgent(this); |
969 | } | 974 | } |
970 | 975 | ||
@@ -1247,6 +1252,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1247 | /// </summary> | 1252 | /// </summary> |
1248 | public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | 1253 | public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) |
1249 | { | 1254 | { |
1255 | // m_log.DebugFormat("[SCENE PRESENCE]: Received agent update from {0}", remoteClient.Name); | ||
1256 | |||
1250 | //if (m_isChildAgent) | 1257 | //if (m_isChildAgent) |
1251 | //{ | 1258 | //{ |
1252 | // // m_log.Debug("DEBUG: HandleAgentUpdate: child agent"); | 1259 | // // m_log.Debug("DEBUG: HandleAgentUpdate: child agent"); |
@@ -1445,6 +1452,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1445 | { | 1452 | { |
1446 | m_movementflag |= (byte)nudgehack; | 1453 | m_movementflag |= (byte)nudgehack; |
1447 | } | 1454 | } |
1455 | |||
1456 | // m_log.DebugFormat("[SCENE PRESENCE]: Updating m_movementflag for {0} with {1}", Name, DCF); | ||
1448 | m_movementflag += (byte)(uint)DCF; | 1457 | m_movementflag += (byte)(uint)DCF; |
1449 | update_movementflag = true; | 1458 | update_movementflag = true; |
1450 | } | 1459 | } |
@@ -1456,6 +1465,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1456 | && ((m_movementflag & (byte)nudgehack) == nudgehack)) | 1465 | && ((m_movementflag & (byte)nudgehack) == nudgehack)) |
1457 | ) // This or is for Nudge forward | 1466 | ) // This or is for Nudge forward |
1458 | { | 1467 | { |
1468 | // m_log.DebugFormat("[SCENE PRESENCE]: Updating m_movementflag for {0} with lack of {1}", Name, DCF); | ||
1459 | m_movementflag -= ((byte)(uint)DCF); | 1469 | m_movementflag -= ((byte)(uint)DCF); |
1460 | update_movementflag = true; | 1470 | update_movementflag = true; |
1461 | 1471 | ||
@@ -1520,12 +1530,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1520 | // which occurs later in the main scene loop | 1530 | // which occurs later in the main scene loop |
1521 | if (update_movementflag || (update_rotation && DCFlagKeyPressed)) | 1531 | if (update_movementflag || (update_rotation && DCFlagKeyPressed)) |
1522 | { | 1532 | { |
1523 | // m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); | 1533 | // m_log.DebugFormat( |
1524 | // m_log.DebugFormat( | 1534 | // "[SCENE PRESENCE]: In {0} adding velocity of {1} to {2}, umf = {3}, ur = {4}", |
1525 | // "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3); | 1535 | // m_scene.RegionInfo.RegionName, agent_control_v3, Name, update_movementflag, update_rotation); |
1526 | 1536 | ||
1527 | AddNewMovement(agent_control_v3); | 1537 | AddNewMovement(agent_control_v3); |
1528 | } | 1538 | } |
1539 | // else | ||
1540 | // { | ||
1541 | // if (!update_movementflag) | ||
1542 | // { | ||
1543 | // m_log.DebugFormat( | ||
1544 | // "[SCENE PRESENCE]: In {0} ignoring requested update of {1} for {2} as update_movementflag = false", | ||
1545 | // m_scene.RegionInfo.RegionName, agent_control_v3, Name); | ||
1546 | // } | ||
1547 | // } | ||
1529 | 1548 | ||
1530 | if (update_movementflag && m_parentID == 0) | 1549 | if (update_movementflag && m_parentID == 0) |
1531 | Animator.UpdateMovementAnimations(); | 1550 | Animator.UpdateMovementAnimations(); |
@@ -3178,7 +3197,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3178 | ISceneObject clone = sog.CloneForNewScene(); | 3197 | ISceneObject clone = sog.CloneForNewScene(); |
3179 | // Attachment module assumes that GroupPosition holds the offsets...! | 3198 | // Attachment module assumes that GroupPosition holds the offsets...! |
3180 | ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; | 3199 | ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; |
3181 | ((SceneObjectGroup)clone).RootPart.IsAttachment = false; | 3200 | ((SceneObjectGroup)clone).IsAttachment = false; |
3182 | cAgent.AttachmentObjects.Add(clone); | 3201 | cAgent.AttachmentObjects.Add(clone); |
3183 | string state = sog.GetStateSnapshot(); | 3202 | string state = sog.GetStateSnapshot(); |
3184 | cAgent.AttachmentObjectStates.Add(state); | 3203 | cAgent.AttachmentObjectStates.Add(state); |
@@ -3477,7 +3496,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3477 | { | 3496 | { |
3478 | foreach (SceneObjectGroup so in m_attachments) | 3497 | foreach (SceneObjectGroup so in m_attachments) |
3479 | { | 3498 | { |
3480 | if (attachmentPoint == so.RootPart.AttachmentPoint) | 3499 | if (attachmentPoint == so.AttachmentPoint) |
3481 | attachments.Add(so); | 3500 | attachments.Add(so); |
3482 | } | 3501 | } |
3483 | } | 3502 | } |
@@ -3869,12 +3888,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3869 | { | 3888 | { |
3870 | if (grp.HasGroupChanged) // Resizer scripts? | 3889 | if (grp.HasGroupChanged) // Resizer scripts? |
3871 | { | 3890 | { |
3872 | grp.RootPart.IsAttachment = false; | 3891 | grp.IsAttachment = false; |
3873 | grp.AbsolutePosition = grp.RootPart.AttachedPos; | 3892 | grp.AbsolutePosition = grp.RootPart.AttachedPos; |
3874 | // grp.DetachToInventoryPrep(); | 3893 | // grp.DetachToInventoryPrep(); |
3875 | attachmentsModule.UpdateKnownItem(ControllingClient, | 3894 | attachmentsModule.UpdateKnownItem(ControllingClient, |
3876 | grp, grp.GetFromItemID(), grp.OwnerID); | 3895 | grp, grp.GetFromItemID(), grp.OwnerID); |
3877 | grp.RootPart.IsAttachment = true; | 3896 | grp.IsAttachment = true; |
3878 | } | 3897 | } |
3879 | } | 3898 | } |
3880 | } | 3899 | } |