aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs19
1 files changed, 10 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b5f789b..e8178ce 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -990,23 +990,24 @@ namespace OpenSim.Region.Framework.Scenes
990 /// <param name="pos"></param> 990 /// <param name="pos"></param>
991 public void Teleport(Vector3 pos) 991 public void Teleport(Vector3 pos)
992 { 992 {
993 bool isFlying = Flying; 993 TeleportWithMomentum(pos, null);
994 RemoveFromPhysicalScene();
995 Velocity = Vector3.Zero;
996 CheckLandingPoint(ref pos);
997 AbsolutePosition = pos;
998 AddToPhysicalScene(isFlying);
999
1000 SendTerseUpdateToAllClients();
1001 } 994 }
1002 995
1003 public void TeleportWithMomentum(Vector3 pos) 996 public void TeleportWithMomentum(Vector3 pos, Vector3? v)
1004 { 997 {
1005 bool isFlying = Flying; 998 bool isFlying = Flying;
999 Vector3 vel = Velocity;
1006 RemoveFromPhysicalScene(); 1000 RemoveFromPhysicalScene();
1007 CheckLandingPoint(ref pos); 1001 CheckLandingPoint(ref pos);
1008 AbsolutePosition = pos; 1002 AbsolutePosition = pos;
1009 AddToPhysicalScene(isFlying); 1003 AddToPhysicalScene(isFlying);
1004 if (PhysicsActor != null)
1005 {
1006 if (v.HasValue)
1007 PhysicsActor.SetMomentum((Vector3)v);
1008 else
1009 PhysicsActor.SetMomentum(vel);
1010 }
1010 1011
1011 SendTerseUpdateToAllClients(); 1012 SendTerseUpdateToAllClients();
1012 } 1013 }