changeset 271:fbd94a0be29c

Fix for units.
author James D. Callahan III <jcallahan@curse.com>
date Thu, 21 Mar 2013 15:23:41 -0500
parents e1566483082c
children e9670d6c6bf1
files Comments.lua
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Comments.lua	Thu Mar 21 15:11:34 2013 -0500
+++ b/Comments.lua	Thu Mar 21 15:23:41 2013 -0500
@@ -197,7 +197,11 @@
     end)
 
     local function CreateComment(cell, func)
-        func()
+        if _G.type(func) == "table" then
+            func[1](func[2])
+        else
+            func()
+        end
         display = display:Release()
     end
 
@@ -249,7 +253,7 @@
 
                 if unit_idnum then
                     line = display:AddLine(("%s: %s"):format(unit_id:gsub("^%l", _G.string.upper), _G.UnitName(unit_id)))
-                    display:SetLineScript(line, "OnMouseUp", CreateComment, CreateUnitComment)
+                    display:SetLineScript(line, "OnMouseUp", CreateComment, { CreateUnitComment, unit_id })
                 end
             end
         end