Giter Club home page Giter Club logo

Comments (2)

davidcraig avatar davidcraig commented on September 3, 2024

Yea I've seen this happen too, very curious bug, no idea how/why it happens, I first noticed it in pre-patch where all the currencies became "Korrak's Revenge" - #7 - i'll keep an eye out.

from broker_currencyflow.

Rubio9 avatar Rubio9 commented on September 3, 2024

I have a fix for this - you're referencing a variable "name" that is never set in Currencyflow:LoadCurrencies().
I also refactored the function a bit to do what you were doing already but with considerably less repetition of the code.
See below.

-- This function tries to update the currencies list with client info
function Currencyflow:LoadCurrencies()
  for id,currency in pairs(tracking) do
    local name, icon
    if currency.type == TYPE_CURRENCY then
      local currencyInfo = C_CurrencyInfo.GetCurrencyInfo(id)
      if currencyInfo ~= nil then
        name = currencyInfo.name
        icon = currencyInfo.iconFileID
      end
    elseif currency.type == TYPE_ITEM then
      name, _, _, _, _, _, _, _, _, icon, _ = GetItemInfo(id)
    elseif currency.type == TYPE_FRAGMENT then
      local name, icon, _, _ = GetArchaeologyRaceInfo(currency.index)
      -- Another dumb marvel of blizz consistency. When info
      -- is not available, instead of returning nil or "",
      -- this one puts "UNKNOWN" in the name.... sigh...
      if icon == nil or icon == "" then
         name = nil
      end
    end

    if name ~= nil and name ~= "" then
       currency.name = name
    else
       currency.name = "|cff999999"..currency.name.."|r"
    end

    if icon ~= nil and icon ~= "" then
       currency.icon = icon
    else
       currency.icon = ICON_QM
    end
  end
end

from broker_currencyflow.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.