View Single Post
11-10-14, 04:27 PM   #14
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Just so you know, you do not need to explicitly need to check for true, false, or nil in Lua. For readability, these are the same.
Code:
-- the value is true
if a == true then ...
if a ~= false then ...
if a ~= nil then ...
if a then ... <-- use this!

-- the value is false or nil
if a == false then ...
if a == nil then ...
if a ~= true then ...
if not a then ... <-- use this!
Only explicitly check if the value of a can be tri-state, like true/false/nil or 1/0/nil.
  Reply With Quote