From 7a9f0e39d327b5466aea14abc17412791abfdb74 Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 16 Jul 2022 10:52:15 +0200 Subject: [PATCH] nameplates: ignore updates on invisible plates --- modules/nameplates.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 3cf122e4..8fad31e5 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -468,6 +468,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () end nameplates.OnDataChanged = function(self, plate) + local visible = plate:IsVisible() local hp = plate.original.healthbar:GetValue() local hpmin, hpmax = plate.original.healthbar:GetMinMaxValues() local name = plate.original.name:GetText() @@ -482,6 +483,9 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () elite = plate.original.levelicon:IsShown() and not player and "boss" or elite if not class then plate.wait_for_scan = true end + -- skip data updates on invisible frames + if not visible then return end + -- target event sometimes fires too quickly, where nameplate identifiers are not -- yet updated. So while being inside this event, we cannot trust the unitstr. if event == "PLAYER_TARGET_CHANGED" then unitstr = nil end