DynamicCam

DynamicCam

1M Downloads

Missing "UnitBuff" in some files

fubaWoW opened this issue ยท 1 comments

commented

Hi there,

as of the UnitBuff function was removed or better say moved, some of your code throws errors but they're easy to fix!

in SituationManager.lua change from:

for i = 1, 40 do
  local name, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i)
  if spellId == 404464 then return true end
  if spellId == 404468 then return false end
end

to

for i = 1, 40 do
  local buffData = C_UnitAuras.GetBuffDataByIndex("player", i)
  if buffData and buffData.spellId then
    if buffData.spellId == 404464 then return true end
    if buffData.spellId == 404468 then return false end
  end
end

in DefaultSettings.lua change from

for i = 1, 40 do
  local name, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i)
  if spellId and spellId >= 369893 and spellId <= 439321 then
    for _, v in pairs(this.raceBuffs) do
      if v == spellId then
        return true
      end
    end
  end
end
return false

to

for i = 1, 40 do
  local buffData = C_UnitAuras.GetBuffDataByIndex("player", i)
  if (buffData and buffData.spellId) then
    if buffData.spellId and buffData.spellId >= 369893 and buffData.spellId <= 439321 then
    for _, v in pairs(this.raceBuffs) do
      if v == buffData.spellId then
      return true
      end
    end
  end
  end
end
return false

and also in DefaultSettings.lua change from:

local name, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i)
  if spellId == 430747 then return true end
end
return false

to

local buffData = C_UnitAuras.GetBuffDataByIndex("player", i)
  if buffData and buffData.spellId == 430747 then return true end
end
return false

greetings

commented

Thanks a lot, also for the corrections! Should work with release 2.8.3 now!