changeset 47:f861e1c0535b v1.0beta11

Take into account that sheathing while drawing doesn't actually sheath
author contrebasse
date Sun, 27 Feb 2011 21:24:10 +0100
parents f50094e78073
children baca2f8f91d8
files Degaine.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Degaine.lua	Sun Feb 27 20:44:53 2011 +0100
+++ b/Degaine.lua	Sun Feb 27 21:24:10 2011 +0100
@@ -53,6 +53,7 @@
 local t_lastGossipClosed = 0
 --local wasMounted = IsMounted() -- handle mounts with UNIT_AURA
 local isTradeSkill = false
+local t_lastDegaine = 0 -- Time of the last draw
 
 
 ---------------------------------------------------------------
@@ -76,6 +77,7 @@
 	if t_left<=0 then
 		ToggleSheath()
 		DegaineFrame:SetScript("OnUpdate", nil)
+		t_lastDegaine = GetTime()
 	end
 end
 local start = function(arg_delay)
@@ -84,7 +86,7 @@
 	--DEFAULT_CHAT_FRAME:AddMessage("Go !")
 	--@end-debug@
 
-	if Degaine_isAuto and not InCombatLockdown() then
+	if Degaine_isAuto and (GetTime()-t_lastDegaine)>1 and not InCombatLockdown() then
 		t_left = arg_delay or delay
 		DegaineFrame:SetScript("OnUpdate", Degaine_OnUpdate)
 	end