Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007380opensim[REGION] Script Functionspublic2014-11-19 17:072015-10-07 22:39
Assigned ToBlueWall 
PlatformMono/LinuxOSSlackwareOS Version13.0
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0007380: Key being evaluated as a boolean improperly implemented
DescriptionNULL_KEY is evaluated as true when used as a boolean in scripting.
Steps To Reproducedefault
        key test_key = NULL_KEY;
        if (test_key)
            llSay(0, "Oh dear this shouldn't be true!");
            llSay(0, "Yes, they key is null and evaluates to false.");
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineBulletSim
Script Engine
EnvironmentMono / Linux64
Mono VersionOther
Attached Filesdiff file icon patch.diff [^] (1,045 bytes) 2014-11-19 17:07 [Show Content]

- Relationships

-  Notes
BlueWall (administrator)
2014-11-20 10:00

Applied, thanks for the patch!
BlueWall (administrator)
2014-11-20 10:01

applied: rcfaf904a3b2a

BlueWall (administrator)
2014-11-23 15:52

A user found some discrepancy in this behavior and what is described in the LSL Wiki. See further attachments.
Mata Hari (reporter)
2014-11-23 15:54
edited on: 2014-11-23 16:15

This appears to still be broken (tested with opensim-7813780 r/25464 2014-11-23)

        key thisKey="nonesense";
        if (thisKey) llSay(0,"the string \"nonesense\" returned true even though LSL wiki says it shouldn't");
        else llSay(0,"the string \"nonesense\" behaved they way it's supposed to");
        key anotherKey=NULL_KEY;
        if (anotherKey) llSay(0,"NULL_KEY returned true even though LSL wiki says it shouldn't");
        else llSay(0,"NULL_KEY behaved they way it's supposed to");
        key yetAnotherKey;
        if (yetAnotherKey) llSay(0,"Empty string returned true even though LSL wiki says it shouldn't");
        else llSay(0,"Empty string behaved they way it's supposed to");
[15:53] Primitive: the string "nonesense" returned true even though LSL wiki says it shouldn't
[15:53] Primitive: NULL_KEY returned true even though LSL wiki says it shouldn't
[15:53] Primitive: Empty string behaved they way it's supposed to

According to the LSL Wiki ( [^]):

"if(uuid) will only return true if it is supplied a key that is both (A) valid, and (B) NOT a NULL_KEY. "

UbitUmarov (administrator)
2015-10-07 22:34

at the moment it is not possible to fix this because of the current internal representation of the type key. Hopefully this can be fixed in near future
UbitUmarov (administrator)
2015-10-07 22:39

forgot to mention that found that code like the one on the patch is already present (possible not needed), but at the moment lsl key is not converted to that type key, so it does nothing.

- Issue History
Date Modified Username Field Change
2014-11-19 17:07 cinderblocks New Issue
2014-11-19 17:07 cinderblocks File Added: patch.diff
2014-11-19 17:10 cinderblocks Status new => patch included
2014-11-20 10:00 BlueWall Note Added: 0027006
2014-11-20 10:01 BlueWall Note Added: 0027007
2014-11-20 10:01 BlueWall Status patch included => resolved
2014-11-20 10:01 BlueWall Resolution open => fixed
2014-11-20 10:01 BlueWall Assigned To => BlueWall
2014-11-23 15:52 BlueWall Note Added: 0027015
2014-11-23 15:52 BlueWall Status resolved => feedback
2014-11-23 15:52 BlueWall Resolution fixed => reopened
2014-11-23 15:54 Mata Hari Note Added: 0027016
2014-11-23 16:15 Mata Hari Note Edited: 0027016 View Revisions
2015-10-07 22:34 UbitUmarov Note Added: 0029503
2015-10-07 22:39 UbitUmarov Note Added: 0029504

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker