Give lua a simple means for NULL_KEY evaluating as false
complete
WolfGang Senizen
LSL
key sitter = llAvatarOnSitTarget( );
if(sitter) {
// Do stuff
}
This is probably one of the most used "hack" / "hidden features" of lsl.
Would be amazing if lua could have it too
Lua
Maybe something like this
local sitter = ll.AvatarOnSitTarget()
if sitter.isValid() then
-- Do stuff
end
Log In
H
Harold Linden
complete
H
Harold Linden
This should be fixed now, thanks for reporting this!
ll.OwnerSay(`{COMBAT_LOG_ID.istruthy}`)
ll.OwnerSay(`{NULL_KEY.istruthy}`)
ll.OwnerSay(`{uuid("foo").istruthy}`)
prints
true
false
false
WolfGang Senizen
Harold Linden
Awesome 👍👍👍 !
Signal Linden
planned
Good point! We're adding a
uuid_val.istruthy
(all lowercase is convention in Lua builtins, apparently) to mimic what LSL would do in the if (uuid) {...} case. We're also going to start setting our UUID constants like NULL_KEY
as actual uuid
instances to make it less annoying to compare them.