Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Buy Copy clears debit permissions on original

Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
11-16-2009 06:02
I've long known that (oddly enough) when an object is set to allow users to buy a copy, when they do, the original gets a "changed" event with the CHANGED_OWNER bit set. To detect an actual change in ownership, we have to save the owner key and test it to see if it's changed.

I tried to take advantage of this, for an object where I want to pay someone a commission on each sale. Everything in my shop is "buy" rather than "pay", and I want to keep it that way. (For one thing, you're guaranteed that you get a precise copy of the sales floor model.) The copay script would delete itself for new owners.

Unfortunately, the object loses debit permissions on the "owner change". I consider this a bug. On "owner change", debit permission should be rescinded if and only if llGetOwner() does not match llGetPermissionsKey().

Has anyone else seen this or have any comments? I'm considering opening a Jira. I searched but didn't find one.

I have a simple workaround: have the copay script send a message to another object which pays the commission.
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
11-16-2009 12:21
This seems to avoid the problem, Lear:
CODE
key owner;

default {
state_entry() {
if(owner!=llGetOwner()){
owner=llGetOwner();
llRequestPermissions(owner,PERMISSION_DEBIT);
}



}

changed(integer change){
if(change&CHANGED_OWNER){
if(llGetPermissionsKey()!=owner){
llSay(0,"resetting script");
llResetScript();
}
}
}


}
At least, I've tested something containing this with my alt and the original kept its debit permissions without resetting when she bought a copy of the contents.