diff options
author | UbitUmarov | 2012-06-08 15:48:46 +0100 |
---|---|---|
committer | UbitUmarov | 2012-06-08 15:48:46 +0100 |
commit | 22437af26af8c70c8cab3aece31cfc59595b54b4 (patch) | |
tree | c61cad243e3fe75a592a9ab1dc602ab748afc99b /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | *UNTESTED* let SetPrimParams for avatars parse even unsupported parameters so... (diff) | |
download | opensim-SC-22437af26af8c70c8cab3aece31cfc59595b54b4.zip opensim-SC-22437af26af8c70c8cab3aece31cfc59595b54b4.tar.gz opensim-SC-22437af26af8c70c8cab3aece31cfc59595b54b4.tar.bz2 opensim-SC-22437af26af8c70c8cab3aece31cfc59595b54b4.tar.xz |
*UNTESTED* fix PRIM_LINK_TARGET. Make it work on avatars, set any pending position change on others; don't assume m_host is in same grp that part (possible always is)...
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index cb13855..523a6ca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -8003,7 +8003,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8003 | case (int)ScriptBaseClass.PRIM_TEXT: | 8003 | case (int)ScriptBaseClass.PRIM_TEXT: |
8004 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 8004 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
8005 | case (int)ScriptBaseClass.PRIM_OMEGA: | 8005 | case (int)ScriptBaseClass.PRIM_OMEGA: |
8006 | case (int)ScriptBaseClass.PRIM_LINK_TARGET: | ||
8007 | if (remain < 3) | 8006 | if (remain < 3) |
8008 | return; | 8007 | return; |
8009 | idx += 3; | 8008 | idx += 3; |
@@ -8023,6 +8022,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8023 | 8022 | ||
8024 | idx += 7; | 8023 | idx += 7; |
8025 | break; | 8024 | break; |
8025 | |||
8026 | case (int)ScriptBaseClass.PRIM_LINK_TARGET: | ||
8027 | if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless. | ||
8028 | return; | ||
8029 | LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++); | ||
8030 | LSL_List new_rules = rules.GetSublist(idx, -1); | ||
8031 | setLinkPrimParams((int)new_linknumber, new_rules); | ||
8032 | return; | ||
8026 | } | 8033 | } |
8027 | } | 8034 | } |
8028 | } | 8035 | } |
@@ -8034,6 +8041,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8034 | 8041 | ||
8035 | int idx = 0; | 8042 | int idx = 0; |
8036 | 8043 | ||
8044 | SceneObjectGroup parentgrp = part.ParentGroup; | ||
8045 | |||
8037 | bool positionChanged = false; | 8046 | bool positionChanged = false; |
8038 | LSL_Vector currentPosition = GetPartLocalPos(part); | 8047 | LSL_Vector currentPosition = GetPartLocalPos(part); |
8039 | 8048 | ||
@@ -8073,8 +8082,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8073 | return; | 8082 | return; |
8074 | 8083 | ||
8075 | LSL_Rotation q = rules.GetQuaternionItem(idx++); | 8084 | LSL_Rotation q = rules.GetQuaternionItem(idx++); |
8085 | SceneObjectPart rootPart = parentgrp.RootPart; | ||
8076 | // try to let this work as in SL... | 8086 | // try to let this work as in SL... |
8077 | if (part.ParentID == 0) | 8087 | if (rootPart == part) |
8078 | { | 8088 | { |
8079 | // special case: If we are root, rotate complete SOG to new rotation | 8089 | // special case: If we are root, rotate complete SOG to new rotation |
8080 | SetRot(part, Rot2Quaternion(q)); | 8090 | SetRot(part, Rot2Quaternion(q)); |
@@ -8083,7 +8093,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8083 | { | 8093 | { |
8084 | // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. | 8094 | // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. |
8085 | // sounds like sl bug that we need to replicate | 8095 | // sounds like sl bug that we need to replicate |
8086 | SceneObjectPart rootPart = part.ParentGroup.RootPart; | ||
8087 | SetRot(part, rootPart.RotationOffset * Rot2Quaternion(q)); | 8096 | SetRot(part, rootPart.RotationOffset * Rot2Quaternion(q)); |
8088 | } | 8097 | } |
8089 | 8098 | ||
@@ -8336,7 +8345,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8336 | return; | 8345 | return; |
8337 | 8346 | ||
8338 | string ph = rules.Data[idx++].ToString(); | 8347 | string ph = rules.Data[idx++].ToString(); |
8339 | m_host.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1")); | 8348 | parentgrp.ScriptSetPhantomStatus(ph.Equals("1")); |
8340 | 8349 | ||
8341 | break; | 8350 | break; |
8342 | 8351 | ||
@@ -8389,7 +8398,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8389 | return; | 8398 | return; |
8390 | string temp = rules.Data[idx++].ToString(); | 8399 | string temp = rules.Data[idx++].ToString(); |
8391 | 8400 | ||
8392 | m_host.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1")); | 8401 | parentgrp.ScriptSetTemporaryStatus(temp.Equals("1")); |
8393 | 8402 | ||
8394 | break; | 8403 | break; |
8395 | 8404 | ||
@@ -8442,10 +8451,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8442 | case (int)ScriptBaseClass.PRIM_LINK_TARGET: | 8451 | case (int)ScriptBaseClass.PRIM_LINK_TARGET: |
8443 | if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless. | 8452 | if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless. |
8444 | return; | 8453 | return; |
8454 | |||
8455 | // do a pending position change | ||
8456 | if (positionChanged) | ||
8457 | { | ||
8458 | if (parentgrp == null) | ||
8459 | return; | ||
8460 | |||
8461 | if (parentgrp.RootPart == part) | ||
8462 | { | ||
8463 | |||
8464 | Util.FireAndForget(delegate(object x) | ||
8465 | { | ||
8466 | parentgrp.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z)); | ||
8467 | }); | ||
8468 | } | ||
8469 | else | ||
8470 | { | ||
8471 | part.OffsetPosition = new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z); | ||
8472 | parentgrp.HasGroupChanged = true; | ||
8473 | parentgrp.ScheduleGroupForTerseUpdate(); | ||
8474 | } | ||
8475 | } | ||
8476 | |||
8445 | LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++); | 8477 | LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++); |
8446 | LSL_List new_rules = rules.GetSublist(idx, -1); | 8478 | LSL_List new_rules = rules.GetSublist(idx, -1); |
8447 | setLinkPrimParams((int)new_linknumber, new_rules); | 8479 | setLinkPrimParams((int)new_linknumber, new_rules); |
8448 | |||
8449 | return; | 8480 | return; |
8450 | } | 8481 | } |
8451 | } | 8482 | } |
@@ -8475,7 +8506,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8475 | 8506 | ||
8476 | if (positionChanged) | 8507 | if (positionChanged) |
8477 | { | 8508 | { |
8478 | SceneObjectGroup parentgrp = part.ParentGroup; | ||
8479 | if (parentgrp == null) | 8509 | if (parentgrp == null) |
8480 | return; | 8510 | return; |
8481 | 8511 | ||