Fix the saveBinds fault

Talen-Shei [08-09-15 - 22:09]
Fix the saveBinds fault
Filename
KeyBindSwapper.lua
diff --git a/KeyBindSwapper.lua b/KeyBindSwapper.lua
index fddb92f..73acac6 100644
--- a/KeyBindSwapper.lua
+++ b/KeyBindSwapper.lua
@@ -145,35 +145,42 @@ end
 	-- Used By:		Save Profile Button, /savekeys
 ]]
 function saveBinds(profile)
-	local isSafe = false
-	local accountbound = false
 	if profile then
-		for i=1, #KBS.Global.AvailKeyTables do
-			if KBS.Global.AvailKeyTables[i] == profile then
-				isSafe = true
-			end
-		end
-	elseif KBS.Account.SingleTarget == true then
-		for i=1, #KBS.Global.AvailKeyTables do
-			if KBS.Global.AvailKeyTables[i] == KBS.Account.BindingTarget then
-				isSafe = true
-				profile = KBS.Account.BindingTarget
-				accountbound = true
-			end
-		end
-	elseif accountbound == false then
-		for i=1, #KBS.Global.AvailKeyTables do
-			if KBS.Global.AvailKeyTables[i] == KBS.Character.BindingTarget then
-				isSafe = true
-				profile = KBS.Account.BindingTarget
-				accountbound = true
-			end
-		end
-	end
-	if isSafe = true then
 		getKeyBinds(profile)
+	elseif KBS.Account.SingleTarget = true then
+		getKeyBinds(KBS.Account.BindingTarget)
 	else
-		d("Error!")
+		getKeyBinds(KBS.Character.BindingTarget)
+	end
+	-- local isSafe = false
+	-- local accountbound = false
+	-- if profile then
+	-- 	for i=1, #KBS.Global.AvailKeyTables do
+	-- 		if KBS.Global.AvailKeyTables[i] == profile then
+	-- 			isSafe = true
+	-- 		end
+	-- 	end
+	-- elseif KBS.Account.SingleTarget == true then
+	-- 	for i=1, #KBS.Global.AvailKeyTables do
+	-- 		if KBS.Global.AvailKeyTables[i] == KBS.Account.BindingTarget then
+	-- 			isSafe = true
+	-- 			profile = KBS.Account.BindingTarget
+	-- 			accountbound = true
+	-- 		end
+	-- 	end
+	-- elseif accountbound == false then
+	-- 	for i=1, #KBS.Global.AvailKeyTables do
+	-- 		if KBS.Global.AvailKeyTables[i] == KBS.Character.BindingTarget then
+	-- 			isSafe = true
+	-- 			profile = KBS.Account.BindingTarget
+	-- 			accountbound = true
+	-- 		end
+	-- 	end
+	-- end
+	-- if isSafe = true then
+	-- 	getKeyBinds(profile)
+	-- else
+	-- 	d("Error!")
 end
 	-- if arg2 == nil then
 	-- 	if arg1 == nil then