diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 975d855..1f39c3f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2703,6 +2703,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2703 | Vector3 direc = vec * Rotation; | 2703 | Vector3 direc = vec * Rotation; |
2704 | direc.Normalize(); | 2704 | direc.Normalize(); |
2705 | 2705 | ||
2706 | if (PhysicsActor.Flying != m_flyingOld) // add for fly velocity control | ||
2707 | { | ||
2708 | m_flyingOld = PhysicsActor.Flying; // add for fly velocity control | ||
2709 | if (!PhysicsActor.Flying) | ||
2710 | m_wasFlying = true; // add for fly velocity control | ||
2711 | } | ||
2712 | |||
2713 | if (PhysicsActor.IsColliding == true) | ||
2714 | m_wasFlying = false; // add for fly velocity control | ||
2715 | |||
2716 | if ((vec.Z == 0f) && !PhysicsActor.Flying) | ||
2717 | direc.Z = 0f; // Prevent camera WASD up. | ||
2718 | |||
2706 | direc *= 0.03f * 128f * SpeedModifier; | 2719 | direc *= 0.03f * 128f * SpeedModifier; |
2707 | 2720 | ||
2708 | if (PhysicsActor != null) | 2721 | if (PhysicsActor != null) |
@@ -2721,6 +2734,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2721 | // m_log.Info("[AGENT]: Stop Flying"); | 2734 | // m_log.Info("[AGENT]: Stop Flying"); |
2722 | //} | 2735 | //} |
2723 | } | 2736 | } |
2737 | if (Animator.m_falling && m_wasFlying) // if falling from flying, disable motion add | ||
2738 | { | ||
2739 | direc *= 0.0f; | ||
2740 | } | ||
2724 | else if (!PhysicsActor.Flying && PhysicsActor.IsColliding) | 2741 | else if (!PhysicsActor.Flying && PhysicsActor.IsColliding) |
2725 | { | 2742 | { |
2726 | if (direc.Z > 2.0f) | 2743 | if (direc.Z > 2.0f) |