refactor: Combine ScenePresence.Teleport() and TeleportWithMomentum()

These are identical apart from setting Velocity = zero, which has no practical effect anyway since this is zeroed when the avatar is added back to the physics scene.
0.7.4.1
Justin Clark-Casey (justincc) 2012-04-25 02:07:55 +01:00
parent a65ca24701
commit 683cfc6f82
2 changed files with 1 additions and 17 deletions

View File

@ -992,22 +992,6 @@ namespace OpenSim.Region.Framework.Scenes
{
// m_log.DebugFormat("[SCENE PRESENCE]: Moving {0} to {1} in {2}", Name, pos, Scene.RegionInfo.RegionName);
bool isFlying = Flying;
RemoveFromPhysicalScene();
Velocity = Vector3.Zero;
CheckLandingPoint(ref pos);
AbsolutePosition = pos;
AddToPhysicalScene(isFlying);
SendTerseUpdateToAllClients();
}
public void TeleportWithMomentum(Vector3 pos)
{
// m_log.DebugFormat(
// "[SCENE PRESENCE]: Moving {0} to {1} with existing momentum {2} in {3} ",
// Name, pos, Velocity, Scene.RegionInfo.RegionName);
bool isFlying = Flying;
RemoveFromPhysicalScene();
CheckLandingPoint(ref pos);

View File

@ -68,7 +68,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
public Vector3 WorldPosition
{
get { return GetSP().AbsolutePosition; }
set { GetSP().TeleportWithMomentum(value); }
set { GetSP().Teleport(value); }
}
public bool IsChildAgent