From d98dc297facb2c920d1c03edaef92f6f21fb2af8 Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Fri, 30 Oct 2009 13:59:10 -0500 Subject: [PATCH] Fixed infinite loop possibility in changeFocus() --- config.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config.lua b/config.lua index b01e002..68defa3 100644 --- a/config.lua +++ b/config.lua @@ -116,6 +116,7 @@ end --moves the editbox focus to the next available edit box function changeFocus(currentStatFrame) local frame, offset + local timesLooped = 0 local elements = ww_config.rightPanel.scrollFrame.shown local position = currentStatFrame.category.position + currentStatFrame.position @@ -132,8 +133,13 @@ function changeFocus(currentStatFrame) else position = 1 end + timesLooped = timesLooped + 1 end - until elements[position].statName + until timesLooped == 2 or elements[position].statName + + if timesLooped == 2 then + return + end frame = elements[position] if frame then -- 1.7.9.5