CODE
default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 0.5>, ZERO_ROTATION);
}
changed(integer change)
{
llSay(0,"change:" + (string) change + " AV:" + (string) llAvatarOnSitTarget());
}
}
I would expect the "changed" event to be triggered every time that an AV sits, or unsits on the box.
But what actually happens is that, while the sitting change is always triggered, often (but not always) the "changed" event doesn't trigger when I stand up.
What is really puzzling to me is that if I change the script to :
CODE
key gLastOnSitTarget;
default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 0.5>, ZERO_ROTATION);
gLastOnSitTarget = NULL_KEY;
llSetTimerEvent(1.0);
}
changed(integer change)
{
llSay(0,"change:" + (string) change + " AV:" + (string) llAvatarOnSitTarget());
}
timer()
{
if ( llAvatarOnSitTarget() != gLastOnSitTarget )
{
gLastOnSitTarget = llAvatarOnSitTarget();
llSay(0, "change detected in timer... key:" + (string) gLastOnSitTarget);
}
}
}
Not only does the "timer" event ALWAYS detect the change, but with this polling-type action added, the "changed" event always behaves as I would expect.
Is this a bug, a feature, or am I just being brain-dead here?
- Ace