aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/LSL.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/LSL.lua b/lib/LSL.lua
index 1afc8ec..4ec64b5 100644
--- a/lib/LSL.lua
+++ b/lib/LSL.lua
@@ -1031,10 +1031,10 @@ end
1031 1031
1032-- Lua really hates 0, it's not false, and it can't be a table index. 1032-- Lua really hates 0, it's not false, and it can't be a table index.
1033function LSL.toBool(x) 1033function LSL.toBool(x)
1034 local v = x 1034 local t = type(x)
1035 local t = type(v) 1035
1036 if 'boolean' == t then return v end 1036 if 'boolean' == t then return x end
1037 if 'number' == t then return (v ~= 0) end 1037 if 'number' == t then return (x ~= 0) end
1038 if 'nil' == t then return false end 1038 if 'nil' == t then return false end
1039 -- Is an empty string, empty list, zero vector/rotation false? Fucked if I know. 1039 -- Is an empty string, empty list, zero vector/rotation false? Fucked if I know.
1040 return true 1040 return true