diff options
Patch by Apelsin that fixes behaviour of llSetPos and llGetLocalPos for attachments.
This fixes Mantis #3923.
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to '')
-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 9451005..04c4f7a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1926,7 +1926,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1926 | 1926 | ||
1927 | if (part.ParentGroup.RootPart == part) | 1927 | if (part.ParentGroup.RootPart == part) |
1928 | { | 1928 | { |
1929 | if ((targetPos.z < ground) && disable_underground_movement) | 1929 | if ((targetPos.z < ground) && disable_underground_movement && m_host.AttachmentPoint == 0) |
1930 | targetPos.z = ground; | 1930 | targetPos.z = ground; |
1931 | SceneObjectGroup parent = part.ParentGroup; | 1931 | SceneObjectGroup parent = part.ParentGroup; |
1932 | LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos); | 1932 | LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos); |
@@ -1958,18 +1958,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1958 | protected LSL_Vector GetPartLocalPos(SceneObjectPart part) | 1958 | protected LSL_Vector GetPartLocalPos(SceneObjectPart part) |
1959 | { | 1959 | { |
1960 | m_host.AddScriptLPS(1); | 1960 | m_host.AddScriptLPS(1); |
1961 | if (part.ParentID != 0) | 1961 | if (part.ParentID == 0) |
1962 | { | ||
1963 | return new LSL_Vector(part.OffsetPosition.X, | ||
1964 | part.OffsetPosition.Y, | ||
1965 | part.OffsetPosition.Z); | ||
1966 | } | ||
1967 | else | ||
1968 | { | 1962 | { |
1969 | return new LSL_Vector(part.AbsolutePosition.X, | 1963 | return new LSL_Vector(part.AbsolutePosition.X, |
1970 | part.AbsolutePosition.Y, | 1964 | part.AbsolutePosition.Y, |
1971 | part.AbsolutePosition.Z); | 1965 | part.AbsolutePosition.Z); |
1972 | } | 1966 | } |
1967 | else | ||
1968 | { | ||
1969 | if (m_host.IsRoot) | ||
1970 | { | ||
1971 | return new LSL_Vector(m_host.AttachedPos.X, | ||
1972 | m_host.AttachedPos.Y, | ||
1973 | m_host.AttachedPos.Z); | ||
1974 | } | ||
1975 | else | ||
1976 | { | ||
1977 | return new LSL_Vector(part.OffsetPosition.X, | ||
1978 | part.OffsetPosition.Y, | ||
1979 | part.OffsetPosition.Z); | ||
1980 | } | ||
1981 | } | ||
1973 | } | 1982 | } |
1974 | 1983 | ||
1975 | public void llSetRot(LSL_Rotation rot) | 1984 | public void llSetRot(LSL_Rotation rot) |