From 59b0c2e214f335649e206443f022b5940bf6774c Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Mon, 22 Nov 2010 10:39:49 -0600 Subject: [PATCH] Fixed a nil error that came up when using TipTac Updated version to 1.3r4 --- WeightsWatcher.lua | 18 ++++++++++++++++-- WeightsWatcher.toc | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua index 1904ad2..6b846bf 100644 --- a/WeightsWatcher.lua +++ b/WeightsWatcher.lua @@ -585,9 +585,23 @@ function WeightsWatcher.displayItemStats(tooltip, ttname) start = 2 end + local offset = 0 for i = start, tooltip:NumLines() do - ttleft = _G[ttname .. "TextLeft" .. i] - origTextL = ttleft:GetText() + while true do + ttleft = _G[ttname .. "TextLeft" .. i + offset] + if ttleft == nil then + break + end + origTextL = ttleft:GetText() + if origTextL == nil then + offset = offset + 1 + else + break + end + end + if ttleft == nil or origTextL == nil then + break + end textL = WeightsWatcher.preprocess(origTextL:lower()) if rawget(ww_unparsed_lines, textL) then if showDebugInfo then diff --git a/WeightsWatcher.toc b/WeightsWatcher.toc index 017f42c..e8ecb74 100644 --- a/WeightsWatcher.toc +++ b/WeightsWatcher.toc @@ -2,7 +2,7 @@ ## Title: Weights Watcher ## Notes: Ranks gear according to customizable stat weights ## Author: The Flying Squirrels -## Version: 1.3r3 +## Version: 1.3r4 ## OptionalDeps: AtlasLoot ## SavedVariables: ww_vars ## SavedVariablesPerCharacter: ww_charVars -- 1.7.9.5