Skip to content

Commit

Permalink
Fix no ids on game load, fishing + bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
kvan committed Jul 27, 2024
1 parent 2f5b669 commit df95032
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SmartBuff.buffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ function SMARTBUFF_InitSpellIDs()

-- Misc
SMARTBUFF_KIRUSSOV = getSpellInfoByName(46302); --"K'iru's Song of Victory"
SMARTBUFF_FISHING = getSpellInfoByName(7620) or C_Spell.GetSpellInfo(111541); --"Fishing"
SMARTBUFF_FISHING = C_Spell.GetSpellInfo(450647) or C_Spell.GetSpellInfo(131476); --"Fishing"

-- Scroll
SMARTBUFF_SBAGILITY = getSpellInfoByName(8115); --"Scroll buff: Agility"
Expand Down
14 changes: 8 additions & 6 deletions SmartBuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ function SMARTBUFF_OnEvent(self, event, ...)

-- checks if aspect of cheetah or pack is active and cancel it if someone gets dazed
if (sPlayerClass == "HUNTER" and O.AntiDaze and (arg1 == "player" or string.find(arg1, "^party") or string.find(arg1, "^raid") or string.find(arg1, "pet"))) then
local _, _, stuntex = GetSpellInfo(1604); --get Dazed icon
local _, _, stuntex = C_Spell.GetSpellTexture(1604); --get Dazed icon
if (SMARTBUFF_IsDebuffTexture(arg1, stuntex)) then
buff = nil;
if (arg1 == "player" and SMARTBUFF_CheckBuff(arg1, SMARTBUFF_AOTC)) then
Expand Down Expand Up @@ -1042,6 +1042,7 @@ function SMARTBUFF_SetBuffs()
B[CS()] = {};
end

SMARTBUFF_InitSpellIDs();
SMARTBUFF_InitItemList();
SMARTBUFF_InitSpellList();

Expand Down Expand Up @@ -1295,10 +1296,10 @@ function SMARTBUFF_PreCheck(mode, force)

if (UnitAffectingCombat("player")) then
isCombat = true;
--SMARTBUFF_AddMsgD("In combat");
SMARTBUFF_AddMsgD("In combat");
else
isCombat = false;
--SMARTBUFF_AddMsgD("Out of combat");
SMARTBUFF_AddMsgD("Out of combat");
end

if (not isCombat and isSetBuffs) then
Expand Down Expand Up @@ -1588,7 +1589,7 @@ function SMARTBUFF_IsShapeshifted()
local i;
for i = 1, GetNumShapeshiftForms(), 1 do
local icon, active, castable, spellId = GetShapeshiftFormInfo(i);
local name = GetSpellInfo(spellId);
local name = C_Spell.GetSpellInfo(spellId);
if (active and castable and name ~= SMARTBUFF_DRUID_TREANT) then
return true, name;
end
Expand Down Expand Up @@ -2425,6 +2426,7 @@ end

-- Casts a spell
function SMARTBUFF_doCast(unit, id, spellName, levels, type)
SMARTBUFF_AddMsgD("doCast spellName "..spellName);
if (id == nil) then return 9; end
if (type == SMARTBUFF_CONST_TRACK and (GetTrackingTexture() ~= "Interface\\Minimap\\Tracking\\None")) then
--SMARTBUFF_AddMsgD("Track already enabled: " .. iconTrack);
Expand Down Expand Up @@ -2773,8 +2775,8 @@ end
function SMARTBUFF_IsFishing(unit)
-- spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitChannelInfo("unit")
local spell = UnitChannelInfo(unit);
if (spell ~= nil and SMARTBUFF_FISHING ~= nil and spell == SMARTBUFF_FISHING) then
--SMARTBUFF_AddMsgD("Channeling "..SMARTBUFF_FISHING);
if (spell ~= nil and SMARTBUFF_FISHING["name"] ~= nil and spell == SMARTBUFF_FISHING["name"]) then
SMARTBUFF_AddMsgD("Channeling "..SMARTBUFF_FISHING);
return true;
end
return false;
Expand Down

0 comments on commit df95032

Please sign in to comment.