changeset 350:37c27a7509c4 WoD

Expanded the Debug function to no longer -require- arguments other than the message.
author MMOSimca <MMOSimca@gmail.com>
date Sat, 04 Oct 2014 07:10:44 -0400
parents 146072e39150
children e7cbe43d8418
files Main.lua
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Main.lua	Sat Oct 04 07:09:24 2014 -0400
+++ b/Main.lua	Sat Oct 04 07:10:44 2014 -0400
@@ -188,17 +188,22 @@
 -- HELPERS ------------------------------------------------------------
 
 local function Debug(message, ...)
-    if not DEBUGGING or not message or not ... then
+    if not DEBUGGING or not message then
         return
     end
-    local args = { ... }
-
-    for index = 1, #args do
-        if args[index] == nil then
-            args[index] = "nil"
+    
+    if ... then
+        local args = { ... }
+
+        for index = 1, #args do
+            if args[index] == nil then
+                args[index] = "nil"
+            end
         end
+        _G.print(message:format(unpack(args)))
+    else
+        _G.print(message)
     end
-    _G.print(message:format(unpack(args)))
 end