Jump to content

Inter sim catchup


steph Arnott
 Share

You are about to reply to a thread that has been inactive for 1919 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I find this rather crude. Any idea.

 changed(integer ch)
    {
        if( ch&CHANGED_TELEPORT )
        {
            integer Parcel_Flags = llGetParcelFlags (llGetPos ());
            group_id = llList2Key(llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_GROUP]), 0);
            if (PARCEL_FLAG_ALLOW_CREATE_OBJECTS & Parcel_Flags)
            {
                llMessageLinked(Link_num,Link_Filter_11,"TelePort",owner_id);
                llRequestPermissions(owner_id, PERMISSION_TRIGGER_ANIMATION);
            }
            else if((PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS & Parcel_Flags) && llSameGroup(group_id))
            {
                llMessageLinked(Link_num,Link_Filter_11,"TelePort",owner_id);
                llRequestPermissions(owner_id, PERMISSION_TRIGGER_ANIMATION);
            }
            else
            {
                llOwnerSay ("Parcel dissallows creating objects. Rezzer is now toggled to off");
                //state default;
                llResetScript();
            }
        }
    }

Link to comment
Share on other sites

3 hours ago, steph Arnott said:

This is correct but still seems odd.

if (PARCEL_FLAG_ALLOW_CREATE_OBJECTS & Parcel_Flags || PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS & Parcel_Flags && llSameGroup(group_id))

Because of operator precedence, the result will be mostly based on llSameGroup.

"Land allows all objects, user is not in the same group":

If ( 1 || 1 && 0 ) -> if ( 1 && 0 ) -> false

You should put parentheses around GROUP_OBJECTS and llSameGroup, so they get evaluated together first. Same example:

if ( 1 || (1 && 0) ) -> if ( 1 || 1 ) -> true

Edited by Wulfie Reanimator
  • Like 1
Link to comment
Share on other sites

10 hours ago, Wulfie Reanimator said:

Because of operator precedence, the result will be mostly based on llSameGroup.

"Land allows all objects, user is not in the same group":

If ( 1 || 1 && 0 ) -> if ( 1 && 0 ) -> false

You should put parentheses around GROUP_OBJECTS and llSameGroup, so they get evaluated together first. Same example:

if ( 1 || (1 && 0) ) -> if ( 1 || 1 ) -> true

Okay thankyou i will give it a try. Have a bad head cold so can not think straight at the moment.

  • Like 1
Link to comment
Share on other sites

Just now, Wulfie Reanimator said:

Then why did you write it, I wonder, or where did you find it?

I wrote it years ago when i was learning. I just decided i wanted to clean up an annoying glitch. That glitch can not be resolved because the event is deleted from the que as soon as the agent is detected which i did not know. BTW i did not find it, I wrote it nearly ten years ago.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1919 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...