diff options
author | Justin Clark-Casey (justincc) | 2011-08-27 01:28:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-27 01:28:33 +0100 |
commit | d4d894c20f3a44783172f8e52385d871b03e1aef (patch) | |
tree | 15b1584ae784d3eaf98602eb2ed2f2f159705806 /OpenSim/Region | |
parent | Eliminate duplicate AttachmentPoint properties by always using the one stored... (diff) | |
download | opensim-SC_OLD-d4d894c20f3a44783172f8e52385d871b03e1aef.zip opensim-SC_OLD-d4d894c20f3a44783172f8e52385d871b03e1aef.tar.gz opensim-SC_OLD-d4d894c20f3a44783172f8e52385d871b03e1aef.tar.bz2 opensim-SC_OLD-d4d894c20f3a44783172f8e52385d871b03e1aef.tar.xz |
Stop avatars returning from neighbouring regions from stalling on the border crossing.
On making a root agent, we need to reset the ScenePresence.m_movement_flag so that it doesn't remember the
movement registered to the client when it exited the initial region.
If this is remember, then the client avatar movement isn't updated and it appears to stall in mid-air, though this is resolved with a prod/release of any other direction key.
This bug was probably introduced a few weeks ago. Surprised that nobody brought it up.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 93782ce..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(); |