[Opensim-dev] NULL_Key does not equal FALSE
Grid Master
grid at opensim.life
Wed Nov 6 02:58:10 UTC 2019
I"m not seeing that behavior , with my test script ..
default
{
state_entry()
{
llSitTarget(<0,0,0.5>, ZERO_ROTATION );
}
changed(integer change)
{
if(change & CHANGED_LINK)
{
key agent = llAvatarOnSitTarget();
llOwnerSay((string)agent);
if(agent)
{
llWhisper(0, "agent = true and has sitter");
return;
}
else if (!agent)
{
llWhisper(0, "!agent = false and No Sitter");
return;
}
else llOwnerSay("I'm confused");
}
}
}
And the code shows ,
static public implicit operator Boolean(LSLString s)
{
if (s.m_string.Length == 0)
{
return false;
}
if (s == "00000000-0000-0000-0000-000000000000")
{
return false;
}
else
{
return true;
}
}
On Tue, Nov 5, 2019 at 8:21 PM Cinder Roxley <cinder at alchemyviewer.org>
wrote:
> It’s a bug http://opensimulator.org/mantis/view.php?id=5844
>
>
> On November 5, 2019 at 6:51:37 PM, Frans (mrfrans at gmail.com) wrote:
>
> Hi,
> We have upgraded the OSCC grid to version 0.9.1.0, and I noticed a change
> in script behavior.
> in the past, in version 0.8.2.1 for example, NULL_KEY
> or 00000000-0000-0000-0000-000000000000 would evaluate as FALSE when put in
> a IF statement.
> In the latest version it evaluates as TRUE.
>
> Is this the intended behavior?
>
> Example Script:
>
> > default
> > {
> > state_entry()
> > {
> > llSitTarget(<0,0,0.5>, ZERO_ROTATION );
> > }
> > changed(integer change)
> > {
> > if(change & CHANGED_LINK)
> > {
> > key agent = llAvatarOnSitTarget();
> > llOwnerSay((string)agent);
> > if(agent)
> > {
> > llInstantMessage(llAvatarOnSitTarget(), "test");
> > }
> > }
> > }
> > }
>
>
> Regards,
> --
> Frans Charming
> Jeroen Frans
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at opensimulator.org
> http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at opensimulator.org
> http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev
>
More information about the Opensim-dev
mailing list