sfmict / MountsJournal_Classic

Addon makes it possible to sort mounts on waterfowl, flying, ground and allows to use in suitable conditions (random mount summoning).
Apache License 2.0
1 stars 1 forks source link

[Cata Classic] Magic Broom option not working #21

Open Road-block opened 6 hours ago

Road-block commented 6 hours ago

Environment

Steps to reproduce

Settings > Main >

[v] Use [Magic Broom]

Expected Behaviour

Mount the Magic Broom by default when you have the item

Actual Behaviour

*Nothing*

Debug Output

No Lua errors, this is a logic bug.

Screenshots

Road-block commented 6 hours ago

The problem here is in the macroFrame:getMacro() function.

self.magicBroom when all the short-circuit logic passes ends up being an itemName "Magic Broom". But further down the if self.magicBroom then conditional tries to use it as an array, self.magicBroom.itemID and self.magicBroom.mountID do not exist.

macro = self:getDefMacro()
if self.magicBroom then
    if self.broomID then
        macro = self:addLine(macro, "/use item:"..self.broomID) -- USE ITEM BROOM
    elseif self.broomMountID then
        local name = C_MountJournal.GetMountInfoByID(self.broomMountID)
        macro = self:addLine(macro, "/use "..name) -- USE MOUNT BROOM
    end
    self.lastUseTime = GetTime()
else
        --<snipped>

or similar would work

sfmict commented 2 hours ago

Thx you, fixed :)