aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs43
1 files changed, 42 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 6c690e8..20fe6c6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1958,6 +1958,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1958 return end; 1958 return end;
1959 } 1959 }
1960 1960
1961 protected LSL_Vector GetSetPosTarget(SceneObjectPart part, LSL_Vector targetPos, LSL_Vector fromPos)
1962 {
1963 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
1964 return fromPos;
1965
1966 // Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
1967
1968
1969 float ground = World.GetGroundHeight((float)targetPos.x, (float)targetPos.y);
1970 bool disable_underground_movement = m_ScriptEngine.Config.GetBoolean("DisableUndergroundMovement", true);
1971
1972 if (part.ParentGroup.RootPart == part)
1973 {
1974 if ((targetPos.z < ground) && disable_underground_movement && m_host.ParentGroup.AttachmentPoint == 0)
1975 targetPos.z = ground;
1976 }
1977 LSL_Vector real_vec = SetPosAdjust(fromPos, targetPos);
1978
1979 return real_vec;
1980 }
1981
1961 protected void SetPos(SceneObjectPart part, LSL_Vector targetPos) 1982 protected void SetPos(SceneObjectPart part, LSL_Vector targetPos)
1962 { 1983 {
1963 // Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos) 1984 // Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
@@ -7043,6 +7064,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7043 { 7064 {
7044 int idx = 0; 7065 int idx = 0;
7045 7066
7067 bool positionChanged = false;
7068 LSL_Vector currentPosition = GetPartLocalPos(part);
7069
7046 while (idx < rules.Length) 7070 while (idx < rules.Length)
7047 { 7071 {
7048 int code = rules.GetLSLIntegerItem(idx++); 7072 int code = rules.GetLSLIntegerItem(idx++);
@@ -7059,7 +7083,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7059 return; 7083 return;
7060 7084
7061 v=rules.GetVector3Item(idx++); 7085 v=rules.GetVector3Item(idx++);
7062 SetPos(part, v); 7086 positionChanged = true;
7087 currentPosition = GetSetPosTarget(part, v, currentPosition);
7063 7088
7064 break; 7089 break;
7065 case (int)ScriptBaseClass.PRIM_SIZE: 7090 case (int)ScriptBaseClass.PRIM_SIZE:
@@ -7418,6 +7443,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7418 break; 7443 break;
7419 } 7444 }
7420 } 7445 }
7446
7447 if (positionChanged)
7448 {
7449 if (part.ParentGroup.RootPart == part)
7450 {
7451 SceneObjectGroup parent = part.ParentGroup;
7452 parent.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z));
7453 }
7454 else
7455 {
7456 part.OffsetPosition = new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z);
7457 SceneObjectGroup parent = part.ParentGroup;
7458 parent.HasGroupChanged = true;
7459 parent.ScheduleGroupForTerseUpdate();
7460 }
7461 }
7421 } 7462 }
7422 7463
7423 public LSL_String llStringToBase64(string str) 7464 public LSL_String llStringToBase64(string str)