abunai10 / CaffeineIssues

0 stars 0 forks source link

spell:GetCost() returning incorrectly #22

Open LordNoxington opened 11 months ago

LordNoxington commented 11 months ago

Unlocker: Tinkr & Daemonic Expansion: WoTLK OS: M3 Client Language: English Explanation: Returns 0 most of the time. I believe it is because GetSpellPowerCost() returns a nested table. Bastion doesn't account for the nesting.

As a workaround I did:


function manaForSpell(spell)
    if not spell then return end

    local costs = GetSpellPowerCost(spell:GetID())
    local powerType = player:GetPowerType()

    if costs[1] then
        if player:GetPower(powerType) >= costs[1]["cost"] then
            return true
        end
    else
        return true
    end
end