From 1783c2ca3af9a9b5403734d68d14f4bd37829243 Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 25 Feb 2019 19:47:18 +0100 Subject: [PATCH] libunitscan: smoothen fps in capital cities * only scan one unit per frame to avoid lags --- libs/libunitscan.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/libunitscan.lua b/libs/libunitscan.lua index 215cf89e..fc0ff535 100644 --- a/libs/libunitscan.lua +++ b/libs/libunitscan.lua @@ -142,7 +142,8 @@ if pfUI.client <= 11200 then -- don't scan when another unit is in target if UnitExists("target") or UnitName("target") then return end - for name in pairs(queue) do + local name = next(queue) + if name then -- try to target the unknown unit TargetByName(name, true) ClearTarget()