mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
fix false immunities
This commit is contained in:
@@ -597,8 +597,9 @@ function Extension.OnLoad()
|
||||
end
|
||||
|
||||
function Extension.ADDON_LOADED()
|
||||
-- Check if pfUI just loaded
|
||||
if arg1 == "pfUI" then
|
||||
-- Check if pfUI just loaded AND the global actually exists
|
||||
-- (another addon could be named "pfUI" without being the real UI framework)
|
||||
if arg1 == "pfUI" and pfUI then
|
||||
Extension.pfUILoaded = true
|
||||
-- pfUI modules load after ADDON_LOADED, so schedule a check
|
||||
if CleveRoids.ScheduleTimer then
|
||||
@@ -613,8 +614,8 @@ function Extension.PLAYER_LOGIN()
|
||||
-- Final check after everything is loaded
|
||||
Extension.SetupCompatibility()
|
||||
|
||||
-- Print startup status
|
||||
if Extension.pfUILoaded then
|
||||
-- Print startup status only if pfUI global exists and compatibility was set up
|
||||
if Extension.pfUILoaded and pfUI then
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cff00ff00[SCRM]|r pfUI compatibility loaded. Use /pfuicd for debug.")
|
||||
if not Extension.actionHandlerRegistered then
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000[SCRM]|r WARNING: pfUI action handler NOT registered!")
|
||||
|
||||
@@ -37,11 +37,42 @@ function Extension.UPDATE_MOUSEOVER_UNIT()
|
||||
end
|
||||
end
|
||||
|
||||
-- Clear mouseover when tooltip is set to a non-unit (spell, item, action, etc.)
|
||||
-- This prevents TurtleRP from showing stale RP profile info for spells/items.
|
||||
-- TurtleRP hooks GameTooltip:OnShow and checks UnitIsPlayer("mouseover") -
|
||||
-- if that returns true (from a stale unit frame hover), it overwrites the tooltip.
|
||||
-- By clearing mouseover when non-unit tooltips are shown, we prevent this.
|
||||
function Extension.OnNonUnitTooltip()
|
||||
-- Clear the tooltip source (lowest priority fallback)
|
||||
CleveRoids.ClearMouseoverFrom("tooltip")
|
||||
|
||||
-- Also explicitly clear the game's mouseover to ensure UnitIsPlayer returns false.
|
||||
-- This is defensive - the main fix is in Utility.lua:apply() using "" instead of nil.
|
||||
if CleveRoids.hasSuperwow and _G.SetMouseoverUnit then
|
||||
CleveRoids.__mo.selfTriggered = true
|
||||
_G.SetMouseoverUnit("")
|
||||
end
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetUnit", "SetUnit")
|
||||
Extension.HookMethod(_G["GameTooltip"], "Hide", "OnClose")
|
||||
Extension.HookMethod(_G["GameTooltip"], "FadeOut", "OnClose")
|
||||
Extension.RegisterEvent("UPDATE_MOUSEOVER_UNIT", "UPDATE_MOUSEOVER_UNIT")
|
||||
|
||||
-- Hook non-unit tooltip methods to clear stale mouseover state.
|
||||
-- This prevents TurtleRP from showing RP profiles for spells/items.
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetSpell", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetBagItem", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetInventoryItem", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetAction", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetQuestLogItem", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetLootItem", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetMerchantItem", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetCraftItem", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetTradeSkillItem", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetTrainerService", "OnNonUnitTooltip")
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetHyperlink", "OnNonUnitTooltip")
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
|
||||
+17
-1
@@ -331,7 +331,10 @@ do
|
||||
if CleveRoids.hasSuperwow and _G.SetMouseoverUnit then
|
||||
-- Set flag so UPDATE_MOUSEOVER_UNIT handler knows we triggered this
|
||||
CleveRoids.__mo.selfTriggered = true
|
||||
_G.SetMouseoverUnit(unit)
|
||||
-- Use empty string instead of nil to properly clear mouseover.
|
||||
-- SetMouseoverUnit(nil) doesn't properly clear the game's internal state,
|
||||
-- causing UnitIsPlayer("mouseover") to return stale data (TurtleRP bug).
|
||||
_G.SetMouseoverUnit(unit or "")
|
||||
else
|
||||
CleveRoids.mouseoverUnit = unit
|
||||
end
|
||||
@@ -2502,6 +2505,19 @@ delayedTrackingFrame:SetScript("OnUpdate", function()
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif not UnitExists(pending.targetGUID) then
|
||||
-- Target despawned or GUID is invalid - can't verify, skip without recording immunity
|
||||
-- This is similar to one-shot kills: inconclusive result, don't record immunity
|
||||
bleedVerified = false
|
||||
if debug then
|
||||
local spellNameDebug = _SpellInfo(pending.spellID) or "Bleed"
|
||||
DEFAULT_CHAT_FRAME:AddMessage(
|
||||
_string_format("|cffaaaaaa[Bleed Skip]|r %s on %s - target no longer exists (despawned), can't determine immunity",
|
||||
spellNameDebug, pending.targetName or "Unknown")
|
||||
)
|
||||
end
|
||||
-- Note: We set bleedVerified = false but DON'T record immunity
|
||||
-- This is intentional - despawned targets are inconclusive
|
||||
else
|
||||
-- Target is alive - check debuffs by GUID (SuperWoW supports GUID-based queries)
|
||||
bleedVerified = false
|
||||
|
||||
Reference in New Issue
Block a user