aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs25
1 files changed, 17 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 1e2e0c8..a407ef3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2120,7 +2120,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2120 2120
2121 if (part.ParentGroup.RootPart == part) 2121 if (part.ParentGroup.RootPart == part)
2122 { 2122 {
2123 if ((targetPos.z < ground) && disable_underground_movement) 2123 if ((targetPos.z < ground) && disable_underground_movement && m_host.AttachmentPoint == 0)
2124 targetPos.z = ground; 2124 targetPos.z = ground;
2125 SceneObjectGroup parent = part.ParentGroup; 2125 SceneObjectGroup parent = part.ParentGroup;
2126 LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos); 2126 LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos);
@@ -2152,18 +2152,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2152 protected LSL_Vector GetPartLocalPos(SceneObjectPart part) 2152 protected LSL_Vector GetPartLocalPos(SceneObjectPart part)
2153 { 2153 {
2154 m_host.AddScriptLPS(1); 2154 m_host.AddScriptLPS(1);
2155 if (part.ParentID != 0) 2155 if (part.ParentID == 0)
2156 {
2157 return new LSL_Vector(part.OffsetPosition.X,
2158 part.OffsetPosition.Y,
2159 part.OffsetPosition.Z);
2160 }
2161 else
2162 { 2156 {
2163 return new LSL_Vector(part.AbsolutePosition.X, 2157 return new LSL_Vector(part.AbsolutePosition.X,
2164 part.AbsolutePosition.Y, 2158 part.AbsolutePosition.Y,
2165 part.AbsolutePosition.Z); 2159 part.AbsolutePosition.Z);
2166 } 2160 }
2161 else
2162 {
2163 if (m_host.IsRoot)
2164 {
2165 return new LSL_Vector(m_host.AttachedPos.X,
2166 m_host.AttachedPos.Y,
2167 m_host.AttachedPos.Z);
2168 }
2169 else
2170 {
2171 return new LSL_Vector(part.OffsetPosition.X,
2172 part.OffsetPosition.Y,
2173 part.OffsetPosition.Z);
2174 }
2175 }
2167 } 2176 }
2168 2177
2169 public void llSetRot(LSL_Rotation rot) 2178 public void llSetRot(LSL_Rotation rot)