From f4498983aa2f498321fbc508a2f41b390914bee7 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 8 Jul 2009 10:22:51 +0000 Subject: Prevent scripts from moving prims underground --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a90d20c..9f02880 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1855,8 +1855,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { targetPos = currentPos + m_ScriptDistanceFactor * 10.0f * llVecNorm(targetPos - currentPos); } - + float ground = World.GetGroundHeight((float)targetPos.x, (float)targetPos.y); + if (targetPos.z < ground) + targetPos.z = ground; + if (part.ParentGroup == null) { part.UpdateOffSet(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); -- cgit v1.1