From 7137b1349850030171509d0096b8cf9283fadf86 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 6 Jun 2008 13:24:40 +0000 Subject: * This limits avatar to the heightfield height if they teleport or cross a border to a position below it. After teleporting, you can go under the terrain if you like as usual. --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index aca0f9d..2215850 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -592,7 +592,12 @@ namespace OpenSim.Region.Environment.Scenes // Name, UUID, m_scene.RegionInfo.RegionName); m_isChildAgent = false; - + float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); + float newPosZ = posZLimit + m_avHeight; + if (posZLimit >= (pos.Z -(m_avHeight/2)) && !(Single.IsInfinity(newPosZ) && Single.IsNaN(newPosZ))) + { + pos.Z = newPosZ; + } AbsolutePosition = pos; AddToPhysicalScene(); -- cgit v1.1