fix xperl issues

This commit is contained in:
Jrc13245
2026-01-10 10:39:25 -05:00
parent 05d1e2186b
commit 1160baedc9
5 changed files with 20 additions and 52 deletions
+9 -2
View File
@@ -296,6 +296,9 @@ do
return bestSource, bestUnit
end
-- Re-entrancy guard to prevent stack overflow from UI update cascades
local isUpdatingMouseover = false
local function apply(unit)
if CleveRoids.hasSuperwow and _G.SetMouseoverUnit then
_G.SetMouseoverUnit(unit)
@@ -306,17 +309,19 @@ do
end
function CleveRoids.SetMouseoverFrom(source, unit)
if not source then return end
if not source or isUpdatingMouseover then return end
CleveRoids.__mo.sources[source] = unit
local _, bestUnit = getBest()
if bestUnit ~= CleveRoids.__mo.current then
CleveRoids.__mo.current = bestUnit
isUpdatingMouseover = true
apply(bestUnit)
isUpdatingMouseover = false
end
end
function CleveRoids.ClearMouseoverFrom(source, unitIfMatch)
if not source then return end
if not source or isUpdatingMouseover then return end
if unitIfMatch and CleveRoids.__mo.sources[source] ~= unitIfMatch then
return
end
@@ -324,7 +329,9 @@ do
local _, bestUnit = getBest()
if bestUnit ~= CleveRoids.__mo.current then
CleveRoids.__mo.current = bestUnit
isUpdatingMouseover = true
apply(bestUnit)
isUpdatingMouseover = false
end
end
end