# HG changeset patch # User contrebasse # Date 1291996398 -3600 # Node ID 37ac0d31cf0e18b5485f774bf7c3fd4762c35fcb # Parent 571dcc76d801962bb6dd89c9cc9a3419af9d3a17 No need for this 'done' var anymore diff -r 571dcc76d801 -r 37ac0d31cf0e Degaine.lua --- a/Degaine.lua Fri Dec 10 16:44:07 2010 +0100 +++ b/Degaine.lua Fri Dec 10 16:53:18 2010 +0100 @@ -2,7 +2,8 @@ -- Draw your weapons automagically -- Known bugs : --- si on se lève en sautant ça ne sort pas l'arme (impossible de savoir si on était assis avant) +-- If you stand up by jumping or walking it won't draw your weapon +-- (it's not possible to know if you were sitting or standing before) --@debug@ local debug = false; @@ -34,7 +35,6 @@ local playername = UnitName("player") -- vars -local done = true local t_left = -1 local delay = 2 -- seconds @@ -81,19 +81,15 @@ --------------------------------------------------------------- -- Wait a few seconds before drawing, to be able to see the curren animation (and avoid bugs) local Degaine_OnUpdate = function(self,t_elapsed) - if not done then - t_left = t_left - t_elapsed; - if t_left<=0 then - done = true; - ToggleSheath(); - DegaineFrame:SetScript("OnUpdate", nil); - end + t_left = t_left - t_elapsed; + if t_left<=0 then + ToggleSheath(); + DegaineFrame:SetScript("OnUpdate", nil); end end local start = function() if Degaine_isAuto and not InCombatLockdown() then t_left = delay - done = false DegaineFrame:SetScript("OnUpdate", Degaine_OnUpdate); end end @@ -122,7 +118,6 @@ for k,v in pairs(events1player) do DegaineFrame:UnregisterEvent(k); end for k,v in pairs(events2playername) do DegaineFrame:UnregisterEvent(k); end DegaineFrame:SetScript("OnUpdate", nil); - done = true; end Degaine_ToggleAuto = function() if Degaine_isAuto then