Originally Posted by lyravega
Yeah, I'm trying to grasp my head around those stuff I am used to ternary operators from C, and just recently discovered that I can do the same with LUA's and/or stuff too (and more), which is neat
Lua Code:
local alpha; alpha = allow and 0.5 or 1 --if allow == true then alpha = 0.5 else alpha = 1 end
|
a = b ? c : d
is equal to
a = b and c or d
IFF
c is not "false" or "nil"
It's a minor but very important distinction.