Cleanup props when parent object no longer exists
A timed event to check for the existence of the rezzing object and cleanup when the check fails.
This commit is contained in:
parent
19424493e9
commit
4ff281d1f2
1 changed files with 22 additions and 0 deletions
|
@ -21,6 +21,7 @@ integer prop_id;
|
||||||
integer prop_point;
|
integer prop_point;
|
||||||
integer experience_denied_reason;
|
integer experience_denied_reason;
|
||||||
key originalowner;
|
key originalowner;
|
||||||
|
key parentkey;
|
||||||
key give_prop_warning_request;
|
key give_prop_warning_request;
|
||||||
|
|
||||||
unsit_all()
|
unsit_all()
|
||||||
|
@ -89,6 +90,11 @@ state prop
|
||||||
{
|
{
|
||||||
llSetClickAction(CLICK_ACTION_TOUCH);
|
llSetClickAction(CLICK_ACTION_TOUCH);
|
||||||
}
|
}
|
||||||
|
if(llGetStartParameter())
|
||||||
|
{
|
||||||
|
parentkey = llList2String(llGetObjectDetails(llGetKey(), [OBJECT_REZZER_KEY]), 0);
|
||||||
|
llSetTimerEvent(10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
attach(key id)
|
attach(key id)
|
||||||
|
@ -235,6 +241,22 @@ state prop
|
||||||
llSay(comm_channel, "SAVEPROP|" + (string)prop_id);
|
llSay(comm_channel, "SAVEPROP|" + (string)prop_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timer()
|
||||||
|
{
|
||||||
|
//the parent key should be stored global?
|
||||||
|
if(llGetBoundingBox(parentkey) == [])
|
||||||
|
{
|
||||||
|
if(!llGetAttached())
|
||||||
|
{
|
||||||
|
llDie();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state restart_prop
|
state restart_prop
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue