diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index a30c53ca83..566aef03fb 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -393,16 +393,18 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (!isColliding && currentControlState != motionControlStates.jumping) { - float fallVelocity = actor.Velocity.Z; - // if stable on Hover assume falling - if(actor.PIDHoverActive && fallVelocity < 0.05f) + + if(actor.PIDHoverActive) { - Falling = true; - currentControlState = motionControlStates.falling; - m_lastFallVelocity = fallVelocity; - return "FALLDOWN"; + m_animTickFall = 0; + m_animTickJump = 0; + Falling = false; + currentControlState = motionControlStates.flying; + m_lastFallVelocity = 0f; + return "HOVER"; } + float fallVelocity = actor.Velocity.Z; if (fallVelocity < -2.5f) Falling = true; diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs index 19daf1ab91..ff32808cdf 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs @@ -1263,12 +1263,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde break; case PIDHoverType.GroundAndWater: - if (terrainheight > m_parent_scene.WaterLevel) - targetHoverHeight += terrainheight; - else - targetHoverHeight += m_parent_scene.WaterLevel; + targetHoverHeight += terrainheight > m_parent_scene.WaterLevel ? terrainheight : m_parent_scene.WaterLevel; break; - } // end switch (m_PIDHoverType) + } hoverPIDActive = true;