From 3bffdddc9d0f0f62d7cf4bc6c271a865052ee119 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 15 Feb 2012 19:44:54 +0000 Subject: [PATCH] don't freeze with a sitted avatar in a border without other sim. Still messy :( --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 ++++++++- OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index d964a6f62e..e7c6ee8835 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -537,8 +537,15 @@ namespace OpenSim.Region.Framework.Scenes return; } } + else if (RootPart.PhysActor != null) + { + RootPart.PhysActor.CrossingFailure(); + } - val = AbsolutePosition; + Vector3 oldp = AbsolutePosition; + val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f); + val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f); + val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f); } } diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs index 95a97415ab..073241f2f3 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs @@ -3125,7 +3125,7 @@ Console.WriteLine("ODEPrim JointCreateFixed !!!"); d.BodySetPosition(Body, _position.X, _position.Y, _position.Z); d.BodySetLinearVel(Body, 0, 0, 0); - if (Interlocked.Exchange(ref m_crossingfailures, 0) == 0) + if (Interlocked.Exchange(ref m_crossingfailures, m_crossingfailures) == 0) { // tell base code only once Interlocked.Increment(ref m_crossingfailures); base.RequestPhysicsterseUpdate(); @@ -3133,7 +3133,7 @@ Console.WriteLine("ODEPrim JointCreateFixed !!!"); return; } - if (Interlocked.Exchange(ref m_crossingfailures, 0) > 1) + if (Interlocked.Exchange(ref m_crossingfailures, 0) != 0) { // main simulator had a crossing failure // park it inside region