Code changes to prevent occasional timer misprints.

RagebeastRT [09-28-13 - 01:07]
Code changes to prevent occasional timer misprints.
Filename
RiftAddon.toc
main.lua
diff --git a/RiftAddon.toc b/RiftAddon.toc
index 736def2..7d11905 100644
--- a/RiftAddon.toc
+++ b/RiftAddon.toc
@@ -3,7 +3,7 @@ Name = "RiftActionbarCooldowns"
 NameShort = "RABC"
 Description = "An actionbar overlay to display cooldowns"
 Author = "RagebeastRT"
-Version = "1.4"
+Version = "v1.5_release"
 Email = "mesathunder@yahoo.com"
 Environment = "2.4"
 Embed = {
diff --git a/main.lua b/main.lua
index 90eb454..71d670e 100644
--- a/main.lua
+++ b/main.lua
@@ -94,6 +94,15 @@ end
 function rabc.loadSettings()
 	if rabcSavedSettings.timer == nil then rabcSavedSettings.timer = 1 end
 	if rabcSavedSettings.include == nil then rabcSavedSettings.include = {true, true, true, true, true} end
+	for k, v in pairs(rabcSavedAbils) do
+		if v.start >0 then v.start = 0 print(v.name) end
+		if v.ismacro == true then
+			for i=1, 12 do
+				if v[i] ~= nil  and v[i].start >0 then v[i].start = 0 print(v[i].name) end
+			end
+		end
+	end
+
 	rabc.createBars()
 	rabc.createMinimapButton()
 	rabc.createOptions()
@@ -136,6 +145,7 @@ function rabc.cooldownEnd(h, cooldowns)
 		for k, v in pairs (rabcSavedAbils) do
 			if key == v.id and v.watch == true then
 				v.start = 0
+				v.watch = false
 				rabc.spellcount = rabc.spellcount - 1
 				rabc.mainslottext[v.bar][v.slot]:SetText("")
 				rabc.mainslotframe[v.bar][v.slot]:SetWidth(rabc.mainslotframe[v.bar][v.slot].origsize)
@@ -161,13 +171,13 @@ end
 function rabc.RoleChanged(h, num)
 	if rabcSavedSettings.set ~= num then
 		rabcSavedSettings.set = num
+
 		for k, v in pairs(rabcSavedAbils) do
-			for j = 1, 11 do
-				for i = 1, 12 do
-					rabc.mainslotframe[j][i]:SetTexture(rabc.addonid, "Textures/blank.png")
-					rabc.mainslottext[j][i]:SetText("")
-				end
-			end
+			a = {} i = 1
+			for m in string.gmatch(k, "%d+") do a[i] = m i = i + 1 end
+			bar = tonumber(a[2]) slot = tonumber(a[3])
+			rabc.mainslotframe[bar][slot]:SetTexture(rabc.addonid, "Textures/blank.png")
+			rabc.mainslottext[bar][slot]:SetText("")
 		end
 		rabc.configOptionsBText:SetText("Role #" .. rabcSavedSettings.set)
 		rabc.createAbilityList()