diff options
author | Melanie Thielker | 2009-07-08 10:22:51 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-07-08 10:22:51 +0000 |
commit | f4498983aa2f498321fbc508a2f41b390914bee7 (patch) | |
tree | 18f6bf0fb4e3c28d36a975bb2df05cb32df25ebf | |
parent | Prevent teleports from ending underground (diff) | |
download | opensim-SC-f4498983aa2f498321fbc508a2f41b390914bee7.zip opensim-SC-f4498983aa2f498321fbc508a2f41b390914bee7.tar.gz opensim-SC-f4498983aa2f498321fbc508a2f41b390914bee7.tar.bz2 opensim-SC-f4498983aa2f498321fbc508a2f41b390914bee7.tar.xz |
Prevent scripts from moving prims underground
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 |
1 files changed, 4 insertions, 1 deletions
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 | |||
1855 | { | 1855 | { |
1856 | targetPos = currentPos + m_ScriptDistanceFactor * 10.0f * llVecNorm(targetPos - currentPos); | 1856 | targetPos = currentPos + m_ScriptDistanceFactor * 10.0f * llVecNorm(targetPos - currentPos); |
1857 | } | 1857 | } |
1858 | |||
1859 | 1858 | ||
1859 | float ground = World.GetGroundHeight((float)targetPos.x, (float)targetPos.y); | ||
1860 | if (targetPos.z < ground) | ||
1861 | targetPos.z = ground; | ||
1862 | |||
1860 | if (part.ParentGroup == null) | 1863 | if (part.ParentGroup == null) |
1861 | { | 1864 | { |
1862 | part.UpdateOffSet(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); | 1865 | part.UpdateOffSet(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); |