From f661fdf2aade7b92c82bba9a5e216c796681c2fd Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 25 Jul 2016 06:07:06 +0100
Subject: ubOde bug fix

---
 OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs  | 4 +++-
 OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

(limited to 'OpenSim/Region')

diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index 6ed42d9..437440c 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -546,6 +546,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
         {
             get
             {
+                if (_parent != null)
+                    return ((OdePrim)_parent).Velocity;
+
                 if (_zeroFlag)
                     return Vector3.Zero;
                 return _velocity;
@@ -560,7 +563,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
                 {
                     m_log.WarnFormat("[PHYSICS]: Got NaN Velocity in Object {0}", Name);
                 }
-
             }
         }
 
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index a49c44c..e475d84 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -995,7 +995,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
                             p1.CollidingObj = true;
                             p2.CollidingObj = true;
                         }
-                    else if (p2.Velocity.LengthSquared() > 0.0f)
+                    else if (p1.Velocity.LengthSquared() > 0.0f)
                         p1.CollidingObj = true;
                     }
                 else
-- 
cgit v1.1