Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

[BUG-9866] [PRIM_LINK_TARGET, LINK_THIS] works wrongly with llGetLinkPrimitiveParams #17308

Closed
sl-service-account opened this issue Aug 8, 2015 · 1 comment

Comments

@sl-service-account
Copy link

Steps to Reproduce

  1. Create three cubes, from left to right.
  2. Select them from right to left and link them.
  3. Drop this script inside the MIDDLE prim (link number 2) and run it:
default
{
    state_entry()
    {
        llSetLinkPrimitiveParams(3, [
            PRIM_DESC, "Prim 3",
            PRIM_LINK_TARGET, 1, 
            PRIM_DESC, "Prim 1 (root)",
            PRIM_LINK_TARGET, LINK_THIS, 
            PRIM_DESC, "Prim 2"
            ]);
        list params;
        params = llGetLinkPrimitiveParams(3, [
            PRIM_LINK_TARGET, 1,
            PRIM_DESC,
            PRIM_LINK_TARGET, llGetLinkNumber(),
            PRIM_DESC
            ]);
        llSay(0, "GLPP with llGetLinkNumber(): " + llList2CSV(params));
        params = llGetLinkPrimitiveParams(3, [
            PRIM_LINK_TARGET, 1,
            PRIM_DESC,
            PRIM_LINK_TARGET, LINK_THIS, // <--- problem here
            PRIM_DESC
            ]);
        llSay(0, "GLPP with LINK_THIS: " + llList2CSV(params));
    }
}
  1. Check that the left prim's (root's) description is "Prim 1 (root)", the middle prim's description is "Prim 2" and the right prim's description is "Prim 3". This is an indicator that SLPP is not affected by this bug.
  2. Observe the output.

Actual Behavior

The output is:
[10:14:20] Object: GLPP with llGetLinkNumber(): Prim 1 (root), Prim 2
[10:14:20] Object: GLPP with LINK_THIS: Prim 1 (root), Prim 3

Note the last prim is reported as "Prim 3", not "Prim 2". LINK_THIS reverts to the prim specified as the parameter to the function, rather than the prim the script is in as would be expected.

Expected Behavior

The output should have been:

[10:14:20] Object: GLPP with llGetLinkNumber(): Prim 1 (root), Prim 2
[10:14:20] Object: GLPP with LINK_THIS: Prim 1 (root), Prim 2

LINK_THIS should specify the prim the script is in, not the prim indicated in the first parameter.

Other information

llGetPrimitiveParams, llSetPrimitiveParams, llSetLinkPrimitiveParams, llSetLinkPrimitiveParamsFast all seem to work as expected.

It does not affect descriptions only, it affects every property obtainable through llGetLinkPrimitiveParams.

A workaround is to be aware of this issue (to not be caught by this) and use llGetLinkNumber() instead of LINK_THIS.

Original Jira Fields
Field Value
Issue BUG-9866
Summary [PRIM_LINK_TARGET, LINK_THIS] works wrongly with llGetLinkPrimitiveParams
Type Bug
Priority Unset
Status Closed
Resolution Unactionable
Reporter Sei Lisa (sei.lisa)
Created at 2015-08-08T17:21:04Z
Updated at 2015-08-10T17:08:32Z
{
  'Business Unit': ['Platform'],
  'Date of First Response': '2015-08-10T12:08:32.166-0500',
  "Is there anything you'd like to add?": 'llGetPrimitiveParams, llSetPrimitiveParams, llSetLinkPrimitiveParams, llSetLinkPrimitiveParamsFast all seem to work as expected.\r\n\r\nIt does not affect descriptions only, it affects every property obtainable through llGetLinkPrimitiveParams.\r\n\r\nA workaround is to be aware of this issue (to not be caught by this) and use llGetLinkNumber() instead of LINK_THIS.',
  'ReOpened Count': 0.0,
  'Severity': 'Unset',
  'System': 'SL Simulator',
  'Target Viewer Version': 'viewer-development',
  'What just happened?': 'The output is:\r\n[10:14:20] Object: GLPP with llGetLinkNumber(): Prim 1 (root), Prim 2\r\n[10:14:20] Object: GLPP with LINK_THIS: Prim 1 (root), Prim 3\r\n\r\nNote the last prim is reported as "Prim 3", not "Prim 2". LINK_THIS reverts to the prim specified as the parameter to the function, rather than the prim the script is in as expected.',
  'What were you doing when it happened?': '1. Create three cubes, from left to right.\r\n2. Select them from right to left and link them.\r\n3. Drop this script inside the MIDDLE prim (link number 2) and run it:\r\n\r\n{code}\r\ndefault\r\n{\r\n    state_entry()\r\n    {\r\n        llSetLinkPrimitiveParams(3, [\r\n            PRIM_DESC, "Prim 3",\r\n            PRIM_LINK_TARGET, 1, \r\n            PRIM_DESC, "Prim 1 (root)",\r\n            PRIM_LINK_TARGET, LINK_THIS, \r\n            PRIM_DESC, "Prim 2"\r\n            ]);\r\n        list params;\r\n        params = llGetLinkPrimitiveParams(3, [\r\n            PRIM_LINK_TARGET, 1,\r\n            PRIM_DESC,\r\n            PRIM_LINK_TARGET, llGetLinkNumber(),\r\n            PRIM_DESC\r\n            ]);\r\n        llSay(0, "GLPP with llGetLinkNumber(): " + llList2CSV(params));\r\n        params = llGetLinkPrimitiveParams(3, [\r\n            PRIM_LINK_TARGET, 1,\r\n            PRIM_DESC,\r\n            PRIM_LINK_TARGET, LINK_THIS, // <--- problem here\r\n            PRIM_DESC\r\n            ]);\r\n        llSay(0, "GLPP with LINK_THIS: " + llList2CSV(params));\r\n    }\r\n}\r\n{code}\r\n\r\n4. Check that the left prim\'s (root\'s) description is "Prim 1 (root)", the middle prim\'s description is "Prim 2" and the right prim\'s description is "Prim 3".\r\n5. Observe the output.',
  'What were you expecting to happen instead?': 'The output should have been:\r\n\r\n[10:14:20] Object: GLPP with llGetLinkNumber(): Prim 1 (root), Prim 2\r\n[10:14:20] Object: GLPP with LINK_THIS: Prim 1 (root), Prim 2\r\n\r\nLINK_THIS should specify the current prim, not the prim the script is in.',
}
@sl-service-account
Copy link
Author

Grumpity Linden commented at 2015-08-10T17:08:32Z

Won't fix due to potential scary backwards compatibility issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant