From 2e4c8798abf539bddd9770b162acb6d3f3a105ac Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 27 Jul 2016 03:50:47 +0100 Subject: a few more changes on avatar crossing --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index eac7cbc..c375450 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4206,19 +4206,21 @@ namespace OpenSim.Region.Framework.Scenes { // we don't have entity transfer module Vector3 pos = AbsolutePosition; + vel = Velocity; float px = pos.X; if (px < 0) - pos.X += Velocity.X * 2; + pos.X += vel.X * 2; else if (px > m_scene.RegionInfo.RegionSizeX) - pos.X -= Velocity.X * 2; + pos.X -= vel.X * 2; float py = pos.Y; if (py < 0) - pos.Y += Velocity.Y * 2; + pos.Y += vel.Y * 2; else if (py > m_scene.RegionInfo.RegionSizeY) - pos.Y -= Velocity.Y * 2; + pos.Y -= vel.Y * 2; Velocity = Vector3.Zero; + m_AngularVelocity = Vector3.Zero; AbsolutePosition = pos; } } @@ -4231,21 +4233,21 @@ namespace OpenSim.Region.Framework.Scenes RemoveFromPhysicalScene(); Vector3 pos = AbsolutePosition; + Vector3 vel = Velocity; float px = pos.X; if (px < 0) - pos.X += Velocity.X * 2; + pos.X += vel.X * 2; else if (px > m_scene.RegionInfo.RegionSizeX) - pos.X -= Velocity.X * 2; + pos.X -= vel.X * 2; float py = pos.Y; if (py < 0) - pos.Y += Velocity.Y * 2; + pos.Y += vel.Y * 2; else if (py > m_scene.RegionInfo.RegionSizeY) - pos.Y -= Velocity.Y * 2; + pos.Y -= vel.Y * 2; Velocity = Vector3.Zero; m_AngularVelocity = Vector3.Zero; - AbsolutePosition = pos; AddToPhysicalScene(isFlying); -- cgit v1.1