From 7a765e16daff7d1849f9a743c0153cd945646bd2 Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Fri, 23 Jan 2026 20:59:47 +0100 Subject: [PATCH] pvp check for player frame pvp check for player frame --- api/unitframes.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 762516e8..fe29d968 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1117,11 +1117,21 @@ function pfUI.uf.OnUpdate() end -- trigger eventless actions (online/offline/range) - if not this.lastTick then this.lastTick = GetTime() + (this.tick or .2) end - if this.lastTick and this.lastTick < GetTime() then + -- Validate tick value - it should be an interval (e.g. 0.5), not a timestamp + local tickInterval = this.tick + if tickInterval and tickInterval > 10 then + tickInterval = nil + end + -- Reset lastTick if it's invalid (much larger than now) + local now = GetTime() + if this.lastTick and this.lastTick > now + 10 then + this.lastTick = nil + end + if not this.lastTick then this.lastTick = now + (tickInterval or .5) end + if this.lastTick and this.lastTick < now then local unitstr = this.label .. this.id - this.lastTick = GetTime() + (this.tick or .2) + this.lastTick = now + (tickInterval or .5) -- target target has a huge delay, make sure to not tick during range checks -- by waiting for a stable name over three ticks otherwise aborting the update.