mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
fix nampower queuing issues and debuff duration issues
This commit is contained in:
@@ -2095,6 +2095,13 @@ function CleveRoids.DoCast(msg)
|
||||
end
|
||||
|
||||
if CleveRoids.DoWithConditionals(v, CleveRoids.Hooks.CAST_SlashCmd, CleveRoids.FixEmptyTarget, not CleveRoids.hasSuperwow, CastSpellByName) then
|
||||
-- Set stopmacro so subsequent lines in multi-line macros don't execute
|
||||
-- This prevents spell queue replacement issues where Line 2 queues a spell
|
||||
-- and Line 3 immediately replaces it before it can fire
|
||||
-- Only enable this behavior if Nampower queuing is active for at least one spell type
|
||||
if CleveRoids.NampowerAPI and CleveRoids.NampowerAPI.IsAnyQueueingEnabled() then
|
||||
CleveRoids.stopmacro = true
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -190,6 +190,20 @@ function API.IsQueueingEnabled(spellType)
|
||||
return API.GetSettingBool("NP_QueueCastTimeSpells")
|
||||
end
|
||||
|
||||
-- Check if ANY spell queuing is enabled
|
||||
-- Used to determine if stopmacro behavior is needed for multi-line macros
|
||||
function API.IsAnyQueueingEnabled()
|
||||
if not API.features.hasNampower then
|
||||
return false
|
||||
end
|
||||
|
||||
-- Check all spell type queuing settings
|
||||
return API.GetSettingBool("NP_QueueCastTimeSpells")
|
||||
or API.GetSettingBool("NP_QueueInstantSpells")
|
||||
or API.GetSettingBool("NP_QueueChannelingSpells")
|
||||
or API.GetSettingBool("NP_QueueOnSwingSpells")
|
||||
end
|
||||
|
||||
-- Get the queue window for a given spell type (in seconds)
|
||||
function API.GetQueueWindow(spellType)
|
||||
local ms = 500 -- default
|
||||
|
||||
+38
-24
@@ -1559,15 +1559,25 @@ local function SeedUnit(unit)
|
||||
else
|
||||
local duration = lib:GetDuration(spellID)
|
||||
if duration > 0 then
|
||||
-- SHARED DEBUFFS: Always update to refresh stacks and duration
|
||||
-- Check if already exists - if so, preserve caster info
|
||||
local existingCaster = nil
|
||||
if lib.objects[guid] and lib.objects[guid][spellID] then
|
||||
existingCaster = lib.objects[guid][spellID].caster
|
||||
end
|
||||
-- SHARED DEBUFFS: Only seed if not already tracked
|
||||
-- If already tracked via UNIT_CASTEVENT, just update stacks (preserve timer)
|
||||
local existing = lib.objects[guid] and lib.objects[guid][spellID]
|
||||
|
||||
if not (lib.objects[guid] and lib.objects[guid][spellID]) then
|
||||
-- First time seeing this debuff - check for combo spell duration
|
||||
if existing and existing.start and existing.duration then
|
||||
-- Already tracked - only update stacks if different (don't reset timer!)
|
||||
if existing.stacks ~= stacks then
|
||||
existing.stacks = stacks
|
||||
if CleveRoids.debug then
|
||||
local spellName = SpellInfo(spellID) or "Unknown"
|
||||
DEFAULT_CHAT_FRAME:AddMessage(
|
||||
string.format("|cffaaff00[DEBUG SeedUnit Debuff]|r %s (ID:%d) updated stacks to %d (timer preserved)",
|
||||
spellName, spellID, stacks or 0)
|
||||
)
|
||||
end
|
||||
end
|
||||
else
|
||||
-- First time seeing this debuff - add with full duration
|
||||
-- Check for combo spell duration
|
||||
if CleveRoids.IsComboScalingSpellID and CleveRoids.IsComboScalingSpellID(spellID) and
|
||||
CleveRoids_ComboDurations and CleveRoids_ComboDurations[spellID] then
|
||||
-- Use the longest learned duration (assume 5 CP)
|
||||
@@ -1585,11 +1595,8 @@ local function SeedUnit(unit)
|
||||
end
|
||||
end
|
||||
end
|
||||
duration = duration or lib:GetDuration(spellID)
|
||||
lib:AddEffect(guid, unitName, spellID, duration, stacks, nil)
|
||||
end
|
||||
|
||||
-- Always update shared debuffs to keep stacks current
|
||||
lib:AddEffect(guid, unitName, spellID, duration, stacks, existingCaster)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1607,15 +1614,25 @@ local function SeedUnit(unit)
|
||||
else
|
||||
local duration = lib:GetDuration(spellID)
|
||||
if duration > 0 then
|
||||
-- SHARED DEBUFFS: Always update to refresh stacks and duration
|
||||
-- Check if already exists - if so, preserve caster info
|
||||
local existingCaster = nil
|
||||
if lib.objects[guid] and lib.objects[guid][spellID] then
|
||||
existingCaster = lib.objects[guid][spellID].caster
|
||||
end
|
||||
-- SHARED DEBUFFS: Only seed if not already tracked
|
||||
-- If already tracked via UNIT_CASTEVENT, just update stacks (preserve timer)
|
||||
local existing = lib.objects[guid] and lib.objects[guid][spellID]
|
||||
|
||||
if not (lib.objects[guid] and lib.objects[guid][spellID]) then
|
||||
-- First time seeing this debuff - check for combo spell duration
|
||||
if existing and existing.start and existing.duration then
|
||||
-- Already tracked - only update stacks if different (don't reset timer!)
|
||||
if existing.stacks ~= stacks then
|
||||
existing.stacks = stacks
|
||||
if CleveRoids.debug then
|
||||
local spellName = SpellInfo(spellID) or "Unknown"
|
||||
DEFAULT_CHAT_FRAME:AddMessage(
|
||||
string.format("|cffaaff00[DEBUG SeedUnit Buff]|r %s (ID:%d) updated stacks to %d (timer preserved)",
|
||||
spellName, spellID, stacks or 0)
|
||||
)
|
||||
end
|
||||
end
|
||||
else
|
||||
-- First time seeing this debuff - add with full duration
|
||||
-- Check for combo spell duration
|
||||
if CleveRoids.IsComboScalingSpellID and CleveRoids.IsComboScalingSpellID(spellID) and
|
||||
CleveRoids_ComboDurations and CleveRoids_ComboDurations[spellID] then
|
||||
-- Use the longest learned duration (assume 5 CP)
|
||||
@@ -1633,11 +1650,8 @@ local function SeedUnit(unit)
|
||||
end
|
||||
end
|
||||
end
|
||||
duration = duration or lib:GetDuration(spellID)
|
||||
lib:AddEffect(guid, unitName, spellID, duration, stacks, nil)
|
||||
end
|
||||
|
||||
-- Always update shared debuffs to keep stacks current
|
||||
lib:AddEffect(guid, unitName, spellID, duration, stacks, existingCaster)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user