diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 22 |
1 files changed, 14 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 26dba30..759c00a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1919,7 +1919,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1919 | protected void SetPos(SceneObjectPart part, LSL_Vector targetPos) | 1919 | protected void SetPos(SceneObjectPart part, LSL_Vector targetPos) |
1920 | { | 1920 | { |
1921 | // Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos) | 1921 | // Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos) |
1922 | LSL_Vector currentPos = llGetLocalPos(); | 1922 | LSL_Vector currentPos = GetPartLocalPos((part); |
1923 | 1923 | ||
1924 | float ground = World.GetGroundHeight((float)targetPos.x, (float)targetPos.y); | 1924 | float ground = World.GetGroundHeight((float)targetPos.x, (float)targetPos.y); |
1925 | bool disable_underground_movement = m_ScriptEngine.Config.GetBoolean("DisableUndergroundMovement", true); | 1925 | bool disable_underground_movement = m_ScriptEngine.Config.GetBoolean("DisableUndergroundMovement", true); |
@@ -1952,17 +1952,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1952 | public LSL_Vector llGetLocalPos() | 1952 | public LSL_Vector llGetLocalPos() |
1953 | { | 1953 | { |
1954 | m_host.AddScriptLPS(1); | 1954 | m_host.AddScriptLPS(1); |
1955 | if (m_host.ParentID != 0) | 1955 | return GetPartLocalPos(m_host); |
1956 | } | ||
1957 | |||
1958 | protected LSL_Vector GetPartLocalPos(SceneObjectPart part) | ||
1959 | { | ||
1960 | m_host.AddScriptLPS(1); | ||
1961 | if (part.ParentID != 0) | ||
1956 | { | 1962 | { |
1957 | return new LSL_Vector(m_host.OffsetPosition.X, | 1963 | return new LSL_Vector(part.OffsetPosition.X, |
1958 | m_host.OffsetPosition.Y, | 1964 | part.OffsetPosition.Y, |
1959 | m_host.OffsetPosition.Z); | 1965 | part.OffsetPosition.Z); |
1960 | } | 1966 | } |
1961 | else | 1967 | else |
1962 | { | 1968 | { |
1963 | return new LSL_Vector(m_host.AbsolutePosition.X, | 1969 | return new LSL_Vector(part.AbsolutePosition.X, |
1964 | m_host.AbsolutePosition.Y, | 1970 | part.AbsolutePosition.Y, |
1965 | m_host.AbsolutePosition.Z); | 1971 | part.AbsolutePosition.Z); |
1966 | } | 1972 | } |
1967 | } | 1973 | } |
1968 | 1974 | ||