steph Arnott Posted January 21, 2019 Share Posted January 21, 2019 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 More sharing options...
steph Arnott Posted January 21, 2019 Author Share Posted January 21, 2019 I just realized i could have removed the second and done it in one. WHOOP WHOOP. Link to comment Share on other sites More sharing options...
steph Arnott Posted January 21, 2019 Author Share Posted January 21, 2019 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)) Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted January 21, 2019 Share Posted January 21, 2019 (edited) 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 January 21, 2019 by Wulfie Reanimator 1 Link to comment Share on other sites More sharing options...
steph Arnott Posted January 21, 2019 Author Share Posted January 21, 2019 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. 1 Link to comment Share on other sites More sharing options...
steph Arnott Posted January 24, 2019 Author Share Posted January 24, 2019 On 1/21/2019 at 12:06 PM, Wulfie Reanimator said: The only thing this does is stop an on screen message that objects can not be rezzed (PARCEL_FLAG_ALLOW_CREATE_OBJECTS & Parcel_Flags) I can not see any point as to why it even exists. It is utterly pointless. Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted January 24, 2019 Share Posted January 24, 2019 29 minutes ago, steph Arnott said: The only thing this does is stop an on screen message that objects can not be rezzed (PARCEL_FLAG_ALLOW_CREATE_OBJECTS & Parcel_Flags) I can not see any point as to why it even exists. It is utterly pointless. Then why did you write it, I wonder, or where did you find it? Link to comment Share on other sites More sharing options...
steph Arnott Posted January 24, 2019 Author Share Posted January 24, 2019 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 More sharing options...
Recommended Posts
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