llReleaseControls

Dale Innis daleinnisemail at gmail.com
Sun Feb 15 19:17:56 PST 2009


How very odd!  I take back everything I said.  :)  Seems odd that
releasing the control-key interception should also give up the
permission to take it in the first place, but experiment trumps
intuition, especially in LSL...


On Sun, Feb 15, 2009 at 9:23 PM, Tori C. <holydoughnuts at gmail.com> wrote:
> The description at wiki.secondlife.com seems to simply be mistaken,
> the behavior described at
> http://www.lslwiki.net/lslwiki/wakka.php?wakka=llReleaseControls is a
> couple of years old now and seems to still be correct.  Namely,
> llReleaseControls() doesn't require permissions, and does turn off
> PERMISSION_TAKE_CONTROLS as described there.  This is the little test
> I used to check if lslwiki.net still matched reality:
>
> default
> {
>    touch_start(integer total_number)
>    {
>        if (llGetPermissions() & PERMISSION_TAKE_CONTROLS) {
>            llOwnerSay("control permission active, releasing..");
>            llReleaseControls();
>
>            // see if llReleaseControls took away control perms
>            if (llGetPermissions() & PERMISSION_TAKE_CONTROLS) {
>                llOwnerSay("...but still have them!"); // shouldn't happen
>            }
>            else {
>                llOwnerSay("...and they are gone.");
>                llTakeControls(CONTROL_FWD, TRUE, TRUE);
>                llOwnerSay("tried to take controls, this attempt should fail");
>            }
>        }
>        else {
>            llReleaseControls();
>            llOwnerSay("just released controls without permissions,
> should not cause an error");
>            llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
>            llOwnerSay("requested control permission");
>        }
>    }
>
>    run_time_permissions(integer perms) {
>        if (perms & PERMISSION_TAKE_CONTROLS) {
>            llTakeControls(CONTROL_FWD, TRUE, TRUE); // just to
> confirm that the perm works
>            llOwnerSay("took controls, should not be an error here");
>        }
>    }
> }
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
>


More information about the secondlifescripters mailing list