diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7cdbd4b..2710cff 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1262,11 +1262,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1262 | { | 1262 | { |
1263 | return; | 1263 | return; |
1264 | } | 1264 | } |
1265 | |||
1266 | bool update_movementflag = false; | ||
1265 | 1267 | ||
1266 | if (m_allowMovement) | 1268 | if (m_allowMovement) |
1267 | { | 1269 | { |
1268 | int i = 0; | 1270 | int i = 0; |
1269 | bool update_movementflag = false; | 1271 | |
1270 | bool update_rotation = false; | 1272 | bool update_rotation = false; |
1271 | bool DCFlagKeyPressed = false; | 1273 | bool DCFlagKeyPressed = false; |
1272 | Vector3 agent_control_v3 = Vector3.Zero; | 1274 | Vector3 agent_control_v3 = Vector3.Zero; |
@@ -1400,27 +1402,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
1400 | if (LocalVectorToTarget2D.Y > 0)//MoveLeft | 1402 | if (LocalVectorToTarget2D.Y > 0)//MoveLeft |
1401 | { | 1403 | { |
1402 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; | 1404 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; |
1405 | //AgentControlFlags | ||
1406 | AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT; | ||
1403 | update_movementflag = true; | 1407 | update_movementflag = true; |
1404 | } | 1408 | } |
1405 | else if (LocalVectorToTarget2D.Y < 0) //MoveRight | 1409 | else if (LocalVectorToTarget2D.Y < 0) //MoveRight |
1406 | { | 1410 | { |
1407 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT; | 1411 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT; |
1412 | AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT; | ||
1408 | update_movementflag = true; | 1413 | update_movementflag = true; |
1409 | } | 1414 | } |
1410 | if (LocalVectorToTarget2D.X < 0) //MoveBack | 1415 | if (LocalVectorToTarget2D.X < 0) //MoveBack |
1411 | { | 1416 | { |
1412 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_BACK; | 1417 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_BACK; |
1418 | AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_BACK; | ||
1413 | update_movementflag = true; | 1419 | update_movementflag = true; |
1414 | } | 1420 | } |
1415 | else if (LocalVectorToTarget2D.X > 0) //Move Forward | 1421 | else if (LocalVectorToTarget2D.X > 0) //Move Forward |
1416 | { | 1422 | { |
1417 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD; | 1423 | m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD; |
1424 | AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD; | ||
1418 | update_movementflag = true; | 1425 | update_movementflag = true; |
1419 | } | 1426 | } |
1420 | } | 1427 | } |
1421 | catch (Exception) | 1428 | catch (Exception e) |
1422 | { | 1429 | { |
1423 | //Avoid system crash, can be slower but... | 1430 | //Avoid system crash, can be slower but... |
1431 | m_log.DebugFormat("Crash! {0}", e.ToString()); | ||
1424 | } | 1432 | } |
1425 | } | 1433 | } |
1426 | } | 1434 | } |
@@ -1458,11 +1466,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1458 | 1466 | ||
1459 | AddNewMovement(agent_control_v3, q); | 1467 | AddNewMovement(agent_control_v3, q); |
1460 | 1468 | ||
1461 | if (update_movementflag) | 1469 | |
1462 | Animator.UpdateMovementAnimations(); | ||
1463 | } | 1470 | } |
1464 | } | 1471 | } |
1465 | 1472 | ||
1473 | if (update_movementflag) | ||
1474 | Animator.UpdateMovementAnimations(); | ||
1475 | |||
1466 | m_scene.EventManager.TriggerOnClientMovement(this); | 1476 | m_scene.EventManager.TriggerOnClientMovement(this); |
1467 | 1477 | ||
1468 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); | 1478 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); |