Quantcast

changed configSaveWeight to use GetNumber instead of tonumber

Kevin Lyles [10-22-09 - 19:58]
changed configSaveWeight to use GetNumber instead of tonumber
Filename
config.lua
diff --git a/config.lua b/config.lua
index 5211306..4b87262 100644
--- a/config.lua
+++ b/config.lua
@@ -84,15 +84,15 @@ function configResetWeight(weight)
 end

 function configSaveWeight(weight)
+	local number
+
 	for _, frame in pairs(ww_statFrameTable) do
 		if frame.statName then
-			value = frame.statValue:GetText()
-			if value == "" then
-				value = nil
-			else
-				value = tonumber(value)
+			number = frame.statValue:GetNumber()
+			if number == 0 then
+				number = nil
 			end
-			ww_vars.weightsList[weight.category.class][weight.name][frame.statName] = value
+			ww_vars.weightsList[weight.category.class][weight.name][frame.statName] = number
 		end
 	end
 end