diff options
author | Melanie Thielker | 2009-07-08 08:38:23 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-07-08 08:38:23 +0000 |
commit | d8fe7777bf5497b5eab949a0baa279c919ee1ac6 (patch) | |
tree | db9fa786069f2b11ef7c4324d468a1f10d29b25d /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Experimental fix for tilted avatar capsule, Mantis #2905 (diff) | |
download | opensim-SC-d8fe7777bf5497b5eab949a0baa279c919ee1ac6.zip opensim-SC-d8fe7777bf5497b5eab949a0baa279c919ee1ac6.tar.gz opensim-SC-d8fe7777bf5497b5eab949a0baa279c919ee1ac6.tar.bz2 opensim-SC-d8fe7777bf5497b5eab949a0baa279c919ee1ac6.tar.xz |
Prevent teleports from ending underground
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 01facd1..b85a138 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1020,6 +1020,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1020 | look = new Vector3(0.99f, 0.042f, 0); | 1020 | look = new Vector3(0.99f, 0.042f, 0); |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | // Prevent teleporting to an underground location | ||
1024 | // (may crash client otherwise) | ||
1025 | // | ||
1026 | Vector3 pos = AbsolutePosition; | ||
1027 | float ground = m_scene.GetGroundHeight(pos.X, pos.Y); | ||
1028 | if (pos.Z < ground + 1.5f) | ||
1029 | { | ||
1030 | pos.Z = ground + 1.5f; | ||
1031 | AbsolutePosition = pos; | ||
1032 | } | ||
1033 | |||
1023 | if (m_isChildAgent) | 1034 | if (m_isChildAgent) |
1024 | { | 1035 | { |
1025 | m_isChildAgent = false; | 1036 | m_isChildAgent = false; |