TimothyLuke / GSE-Advanced-Macro-Compiler

GSE is an alternative advanced macro editor and engine for World of Warcraft.
https://discord.gg/gseunited
MIT License
218 stars 73 forks source link

[BUG] When changing the icon of an action, it generates a LUA error. #1675

Closed giform closed 1 month ago

giform commented 1 month ago

🔵 *Describe the bug

If I modify the icon of any action within a sequence in GSE, the sequence generates a LUA error. The sequence itself continues to function, but an error is triggered for every block with a modified icon.

Additionally, the context menu to modify the icon no longer appears, making the situation irreversible.

The only way to fix this is by deleting the sequence and re-adding it, or using a backup of the GSE.lua file to revert to the previous state with the default icons.

🔵 To reproduce: (Steps to reproduce the behavior)

  1. open a sequence
  2. edit an icon of an action
  3. fire the sequence
  4. See error

🔵 The error: Paste the error message in this blockquote.

323x GSE/API/Storage.lua:543: attempt to index local 'spellinfo' (a nil value)
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@Blizzard_FrameXML/RestrictedFrames.lua"]:674: in function <Blizzard_FrameXML/RestrictedFrames.lua:673>
[string "@Blizzard_FrameXML/RestrictedFrames.lua"]:812: in function CallMethod'
[string "    local mods = "RALT=" .. tostring(IsRightAltKeyDown()) .. "|" ..
    "LALT=".. tostring(IsLeftAltKeyDown()) .. "|" ..
    "AALT=" .. tostring(IsAltKeyDown()) .. "|" ..
    "RCTRL=" .. tostring(IsRightControlKeyDown()) .. "|" ..
    "LCTRL=" .. tostring(IsLeftControlKeyDown()) .. "|" ..
    "ACTRL=" .. tostring(IsControlKeyDown()) .. "|" ..
    "RSHIFT=" .. tostring(IsRightShiftKeyDown()) .. "|" ..
    "LSHIFT=" .. tostring(IsLeftShiftKeyDown()) .. "|" ..
    "ASHIFT=" .. tostring(IsShiftKeyDown()) .. "|" ..
    "AMOD=" .. tostring(IsModifierKeyDown()) .. "|" ..
    "MOUSEBUTTON=" .. GetMouseButtonClicked()
    self:SetAttribute('localmods', mods)
    local step = self:GetAttribute('step')
    step = tonumber(step)
    if self:GetAttribute('stepped') then
        self:SetAttribute('stepped', false)
    else
        for k,v in pairs(spelllist[step]) do
            if k == "macrotext" then
                self:SetAttribute("macro", nil )
                self:SetAttribute("unit", nil )
            elseif k == "macro" then
                self:SetAttribute("macrotext", nil )
                self:SetAttribute("unit", nil )
            elseif k == "Icon" then
                -- skip
            end
            self:SetAttribute(k, v )
        end

        step = step % #spelllist + 1
        self:SetAttribute('stepped', true)
        self:SetAttribute('step', step)
        self:CallMethod('UpdateIcon')
    end
    "]:34: in function <[string "    local mods = "RALT=" .. tostring(IsRigh..."]:1>
[string "=(tail call)"]: ?
[string "=[C]"]: ?
[string "@Blizzard_FrameXML/RestrictedExecution.lua"]:483: in function <...aceBlizzard_FrameXML/RestrictedExecution.lua:446>
[string "=(tail call)"]: ?
[string "@Blizzard_FrameXML/SecureHandlers.lua"]:285: in function <Blizzard_FrameXML/SecureHandlers.lua:279>
[string "=(tail call)"]: ?
[string "=[C]"]: in function Click'
...
[string "=[C]"]: ?
[string "@Blizzard_FrameXML/SecureHandlers.lua"]:266: in function <Blizzard_FrameXML/SecureHandlers.lua:263>
[string "=[C]"]: ?
[string "@Blizzard_FrameXML/SecureHandlers.lua"]:296: in function <Blizzard_FrameXML/SecureHandlers.lua:279>
[string "=(tail call)"]: ?
[string "=[C]"]: ?
[string "@Blizzard_FrameXML/SecureHandlers.lua"]:266: in function <Blizzard_FrameXML/SecureHandlers.lua:263>
[string "=[C]"]: ?
[string "@Blizzard_FrameXML/SecureHandlers.lua"]:296: in function <Blizzard_FrameXML/SecureHandlers.lua:279>
[string "=(tail call)"]: ?

Locals:

🔵 Screenshots: If applicable, add screenshots to help explain your problem.

🔵 Expected behavior: If I understand correctly, after setting an icon for each action, I should see the icons of the actions cycle through as the sequence is activated.

However, this is not happening.

🔵 GSE.lua file:

GSE.lua.txt

🔵 Desktop (please complete the following information):

🔵 GSE Version:

🔵 Additional context: Add any other context about the problem here.

TimothyLuke commented 1 month ago

To save some time - which sequence is causing this at the moment?

TimothyLuke commented 1 month ago

I worked with your BM_ST. The error was due to quirks with Revive Pet/Mend Pet and it being a smart spell. Please try this again with GSE GSE-3.2.16-b-1-g1e0f765

giform commented 1 month ago

Works like a charm! tyvm Tim