diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 762dbd4..c49559a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1768,17 +1768,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1768 | return; | 1768 | return; |
1769 | } | 1769 | } |
1770 | 1770 | ||
1771 | Vector3 look = Velocity; | ||
1772 | |||
1773 | // if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) | ||
1774 | if ((Math.Abs(look.X) < 0.1) && (Math.Abs(look.Y) < 0.1) && (Math.Abs(look.Z) < 0.1)) | ||
1775 | { | ||
1776 | look = new Vector3(0.99f, 0.042f, 0); | ||
1777 | } | ||
1778 | |||
1779 | // Prevent teleporting to an underground location | 1771 | // Prevent teleporting to an underground location |
1780 | // (may crash client otherwise) | 1772 | // (may crash client otherwise) |
1781 | // | 1773 | // |
1774 | |||
1775 | /* this is done in MakeRootAgent | ||
1782 | Vector3 pos = AbsolutePosition; | 1776 | Vector3 pos = AbsolutePosition; |
1783 | float ground = m_scene.GetGroundHeight(pos.X, pos.Y); | 1777 | float ground = m_scene.GetGroundHeight(pos.X, pos.Y); |
1784 | if (pos.Z < ground + 1.5f) | 1778 | if (pos.Z < ground + 1.5f) |
@@ -1786,7 +1780,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1786 | pos.Z = ground + 1.5f; | 1780 | pos.Z = ground + 1.5f; |
1787 | AbsolutePosition = pos; | 1781 | AbsolutePosition = pos; |
1788 | } | 1782 | } |
1789 | 1783 | */ | |
1790 | bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | 1784 | bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); |
1791 | if (!MakeRootAgent(AbsolutePosition, flying)) | 1785 | if (!MakeRootAgent(AbsolutePosition, flying)) |
1792 | { | 1786 | { |
@@ -1797,6 +1791,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1797 | return; | 1791 | return; |
1798 | } | 1792 | } |
1799 | 1793 | ||
1794 | Vector3 look = Lookat; | ||
1795 | if ((Math.Abs(look.X) < 0.01) && (Math.Abs(look.Y) < 0.01)) | ||
1796 | { | ||
1797 | look = Velocity; | ||
1798 | look.Z = 0; | ||
1799 | look = Util.GetNormalizedVector(look); | ||
1800 | if ((Math.Abs(look.X) < 0.01) && (Math.Abs(look.Y) < 0.01) ) | ||
1801 | look = new Vector3(0.99f, 0.042f, 0); | ||
1802 | } | ||
1803 | |||
1800 | // Tell the client that we're totally ready | 1804 | // Tell the client that we're totally ready |
1801 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | 1805 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); |
1802 | 1806 | ||