diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 25 |
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 dc43e45..21604d0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1936,7 +1936,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1936 | 1936 | ||
1937 | if (part.ParentGroup.RootPart == part) | 1937 | if (part.ParentGroup.RootPart == part) |
1938 | { | 1938 | { |
1939 | if ((targetPos.z < ground) && disable_underground_movement) | 1939 | if ((targetPos.z < ground) && disable_underground_movement && m_host.AttachmentPoint == 0) |
1940 | targetPos.z = ground; | 1940 | targetPos.z = ground; |
1941 | SceneObjectGroup parent = part.ParentGroup; | 1941 | SceneObjectGroup parent = part.ParentGroup; |
1942 | LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos); | 1942 | LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos); |
@@ -1968,18 +1968,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1968 | protected LSL_Vector GetPartLocalPos(SceneObjectPart part) | 1968 | protected LSL_Vector GetPartLocalPos(SceneObjectPart part) |
1969 | { | 1969 | { |
1970 | m_host.AddScriptLPS(1); | 1970 | m_host.AddScriptLPS(1); |
1971 | if (part.ParentID != 0) | 1971 | if (part.ParentID == 0) |
1972 | { | ||
1973 | return new LSL_Vector(part.OffsetPosition.X, | ||
1974 | part.OffsetPosition.Y, | ||
1975 | part.OffsetPosition.Z); | ||
1976 | } | ||
1977 | else | ||
1978 | { | 1972 | { |
1979 | return new LSL_Vector(part.AbsolutePosition.X, | 1973 | return new LSL_Vector(part.AbsolutePosition.X, |
1980 | part.AbsolutePosition.Y, | 1974 | part.AbsolutePosition.Y, |
1981 | part.AbsolutePosition.Z); | 1975 | part.AbsolutePosition.Z); |
1982 | } | 1976 | } |
1977 | else | ||
1978 | { | ||
1979 | if (m_host.IsRoot) | ||
1980 | { | ||
1981 | return new LSL_Vector(m_host.AttachedPos.X, | ||
1982 | m_host.AttachedPos.Y, | ||
1983 | m_host.AttachedPos.Z); | ||
1984 | } | ||
1985 | else | ||
1986 | { | ||
1987 | return new LSL_Vector(part.OffsetPosition.X, | ||
1988 | part.OffsetPosition.Y, | ||
1989 | part.OffsetPosition.Z); | ||
1990 | } | ||
1991 | } | ||
1983 | } | 1992 | } |
1984 | 1993 | ||
1985 | public void llSetRot(LSL_Rotation rot) | 1994 | public void llSetRot(LSL_Rotation rot) |