Skip to content

Commit

Permalink
Fixed for Client 30401
Browse files Browse the repository at this point in the history
Fixed LUA errors with containers.
  • Loading branch information
Softrix committed Jan 18, 2023
1 parent 39dc6e0 commit a7e2618
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 42 deletions.
20 changes: 20 additions & 0 deletions SmartBuff-Wrath.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Interface: 30400
## Title: SmartBuff |cffffffff(Classic WOTLK)|r by |cff00ff00Codermik & Aeldra|r
## Version: 20.30400
## Author: |cff20d2ffCodermik (Mik / Castanova on EU-Mirage Raceway) & Aeldra|r (EU-Proudmoore)
## Notes: Cast the most important buffs on you or party/raid members/pets. Use /sbm for options menu.
## DefaultState: Enabled
## LoadOnDemand: 0
## Notes-deDE: Castet die wichtigsten Buffs auf dich selbst, Gruppe/Raid Mitglieder/Pets. Benutze /sbm um das Men� zu �ffnen
## Notes-frFR: Cast the most important buffs on you or party/raid members/pets. Use /sbm for options menu.
## SavedVariables: SMARTBUFF_OptionsGlobal
## SavedVariablesPerCharacter: SMARTBUFF_Options, SMARTBUFF_Buffs

lib\LibStub\LibStub.lua
lib\CallbackHandler-1.0\CallbackHandler-1.0.lua
lib\LibClassicDurations\LibClassicDurations.xml
SmartBuff.globals.lua
SmartBuff.xml

lib\Broker_SmartBuff\LibDataBroker-1.1.lua
lib\Broker_SmartBuff\Broker_SmartBuff.lua
10 changes: 5 additions & 5 deletions SmartBuff.buffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,10 @@ function SMARTBUFF_InitSpellList()
-- Mage
if (SMARTBUFF_PLAYERCLASS == "MAGE") then
SMARTBUFF_BUFFLIST = {
{SMARTBUFF_DALINT, 30, SMARTBUFF_CONST_GROUP, {1,14,28,42,56,70,80}, "ROGUE;WARRIOR;HPET;WPET;DKPET", S.ChainMageBuffs},
{SMARTBUFF_DALBRILL, 60, SMARTBUFF_CONST_GROUP, {56,70,80}, "ROGUE;WARRIOR;HPET;WPET;DKPET", S.ChainMageBuffs, {SMARTBUFF_ARCANEPOWDER}},
{SMARTBUFF_AI, 30, SMARTBUFF_CONST_GROUP, {1,14,28,42,56,70,80}, "ROGUE;WARRIOR;HPET;WPET;DKPET", S.ChainMageBuffs},
{SMARTBUFF_ABRB1, 60, SMARTBUFF_CONST_GROUP, {56,70,80}, "ROGUE;WARRIOR;HPET;WPET;DKPET", S.ChainMageBuffs, {SMARTBUFF_ARCANEPOWDER}},
{SMARTBUFF_DALINT, 30, SMARTBUFF_CONST_GROUP, {1,14,28,42,56,70,80}, "ROGUE;WARRIOR;DEATHKNIGHT;HPET;WPET", S.ChainMageBuffs},
{SMARTBUFF_DALBRILL, 60, SMARTBUFF_CONST_GROUP, {56,70,80}, "ROGUE;WARRIOR;DEATHKNIGHT;HPET;WPET;DKPET", S.ChainMageBuffs, {SMARTBUFF_ARCANEPOWDER}},
{SMARTBUFF_AI, 30, SMARTBUFF_CONST_GROUP, {1,14,28,42,56,70,80}, "ROGUE;WARRIOR;DEATHKNIGHT;HPET;WPET;DKPET", S.ChainMageBuffs},
{SMARTBUFF_ABRB1, 60, SMARTBUFF_CONST_GROUP, {56,70,80}, "ROGUE;WARRIOR;DEATHKNIGHT;HPET;WPET;DKPET", S.ChainMageBuffs, {SMARTBUFF_ARCANEPOWDER}},
{SMARTBUFF_FOCUSMAGIC, 30, SMARTBUFF_CONST_GROUP, {20}, "WARRIOR;DRUID;SHAMAN;HUNTER;ROGUE;MAGE;PRIEST;PALADIN;WARLOCK;DEATHKNIGHT;HPET;WPET;DKPET"},
{SMARTBUFF_ICEARMOR, 30, SMARTBUFF_CONST_SELF, nil, nil, nil, S.ChainMageArmor},
{SMARTBUFF_FROSTARMOR, 30, SMARTBUFF_CONST_SELF, nil, nil, nil, S.ChainMageArmor},
Expand Down Expand Up @@ -1133,7 +1133,7 @@ function SMARTBUFF_InitSpellList()
{SMARTBUFF_SUPREMEPWRFLASK_ITEM, (60*SMARTBUFF_ALCHEMY_ADJ), SMARTBUFF_CONST_POTION, nil, SMARTBUFF_SUPREMEPWRFLASK_BUFF, S.LinkFlaskClassic},
{SMARTBUFF_FLASKOFFROSTWYRM_ITEM, (60*SMARTBUFF_ALCHEMY_ADJ), SMARTBUFF_CONST_POTION, nil, SMARTBUFF_FLASKOFFROSTWYRM_BUFF, S.LinkFlaskClassic},
{SMARTBUFF_FLASKOFENDLESSRAGE_ITEM, (60*SMARTBUFF_ALCHEMY_ADJ), SMARTBUFF_CONST_POTION, nil, SMARTBUFF_FLASKOFENDLESSRAGE_BUFF, S.LinkFlaskClassic},
{SMARTBUFF_FLASKOFTHENORTH_ITEM, (60*SMARTBUFF_ALCHEMY_ADJ), SMARTBUFF_CONST_POTION, nil, SMARTBUFF_FLASKOFTHENORTH_BUFF, S.LinkFlaskClassic},
{SMARTBUFF_FLASKOFTHENORTH_ITEM, 60, SMARTBUFF_CONST_POTION, nil, SMARTBUFF_FLASKOFTHENORTH_BUFF, S.LinkFlaskClassic},
{SMARTBUFF_FLASKOFSTONEBLOOD_ITEM, (60*SMARTBUFF_ALCHEMY_ADJ), SMARTBUFF_CONST_POTION, nil, SMARTBUFF_FLASKOFSTONEBLOOD_BUFF, S.LinkFlaskClassic},

}
Expand Down
46 changes: 21 additions & 25 deletions SmartBuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
-- Cast the most important buffs on you, tanks or party/raid members/pets.
-------------------------------------------------------------------------------

SMARTBUFF_DATE = "221022 Dev";
SMARTBUFF_VERSION = "r38."..SMARTBUFF_DATE;
SMARTBUFF_DATE = "180122";
SMARTBUFF_VERSION = "r39."..SMARTBUFF_DATE;
SMARTBUFF_VERSIONMIN = 11403; -- min version
SMARTBUFF_VERSIONNR = 30400; -- max version
SMARTBUFF_VERSIONNR = 30401; -- max version
SMARTBUFF_TITLE = "SmartBuff";
SMARTBUFF_SUBTITLE = "Supports casting buffs on tanks, selected classes in party or raids.";
SMARTBUFF_DESC = "Cast the most important buffs on you, tanks, party or raid members/pets";
Expand All @@ -23,7 +23,7 @@ local SmartbuffSession = true;
local SmartbuffVerCheck = false; -- for my use when checking guild users/testers versions :)
local wowVersionString, wowBuild, _, wowTOC = GetBuildInfo();
local isWOTLKC = (_G.WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC and wowTOC >= 30400);
local SmartbuffRevision = 37;
local SmartbuffRevision = 39;
local SmartbuffVerNotifyList = {}

-- Smartbuff now uses LibRangeCheck-2.0 by Mitchnull, not fully implemented
Expand Down Expand Up @@ -3091,8 +3091,8 @@ function SMARTBUFF_CountReagent(reagent, chain)
local itemLink, itemName, count;
if (chain == nil) then chain = { reagent }; end
for bag = 0, NUM_BAG_FRAMES do
for slot = 1, GetContainerNumSlots(bag) do
itemLink = GetContainerItemLink(bag, slot);
for slot = 1, C_Container.GetContainerNumSlots(bag) do
itemLink = C_Container.GetContainerItemLink(bag, slot);
if (itemLink ~= nil) then
itemName = string.match(itemLink, "%[.-%]");
--print(bag, slot, itemName);
Expand All @@ -3101,8 +3101,8 @@ function SMARTBUFF_CountReagent(reagent, chain)
if (chain[i] and string.find(itemName, chain[i], 1, true)) then
--if (chain[i] and string.find(itemLink, "["..chain[i].."]", 1, true)) then
--print("Item found: "..chain[i]);
_, count = GetContainerItemInfo(bag, slot);
id = GetContainerItemID(bag, slot);
_, count = C_Container.GetContainerItemInfo(bag, slot);
id = C_Container.GetContainerItemID(bag, slot);
n = n + count;
end
end
Expand All @@ -3116,32 +3116,28 @@ function SMARTBUFF_FindItem(reagent, chain)
if (reagent == nil) then
return nil, nil, -1, nil;
end

--local toy = SG.Toybox[reagent];
--if (toy) then
-- return 999, toy[1], 1, toy[2];
--end


local n = 0;
local bag = 0;
local slot = 0;
local itemsInfo;
local itemLink, itemName, texture, count;
if (chain == nil) then chain = { reagent }; end

for bag = 0, NUM_BAG_FRAMES do
for slot = 1, GetContainerNumSlots(bag) do
itemLink = GetContainerItemLink(bag, slot);
for slot = 1, C_Container.GetContainerNumSlots(bag) do
itemLink = C_Container.GetContainerItemLink(bag, slot);
if (itemLink ~= nil) then
--itemName = string.match(itemLink, "item[%-?%d:]+");
--itemName = string.match(itemLink, "|h%[.*%]|h");
itemName = string.match(itemLink, "%[.-%]");
-- print(bag, slot, itemName);
--SMARTBUFF_AddMsgD("Reagent found: " .. itemLink);
for i = 1, #chain, 1 do
--if (chain[i] and string.find(itemName, chain[i], 1, true)) then
if (chain[i] and string.find(itemLink, "["..chain[i].."]", 1, true)) then
-- print("Item found: "..chain[i]);
texture, count = GetContainerItemInfo(bag, slot);
return bag, slot, count, texture;
-- itemInfo now returns a table, thanks bliz :)
itemsInfo = C_Container.GetContainerItemInfo(bag, slot);
if itemsInfo then
return bag, slot, itemsInfo.stackCount, texture;
else
return nil, nil, 0, nil;
end
end
end
end
Expand Down Expand Up @@ -3266,7 +3262,7 @@ end
-- Init the SmartBuff variables ---------------------------------------------------------------------------------------
function SMARTBUFF_Options_Init(self)
if (isInit) then return; end

self:UnregisterEvent("CHAT_MSG_CHANNEL");
self:UnregisterEvent("UPDATE_MOUSEOVER_UNIT");

Expand Down
4 changes: 2 additions & 2 deletions SmartBuff.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 30400
## Interface: 30401
## Title: |TInterface\Addons\Smartbuff\Icons\IconEnabled:0|t SmartBuff |cffffffff(WOTLK Classic)|r
## Version: 38.30400
## Version: 39.30401
## Author: |cff20d2ffCodermik (Mik / Castanova on EU-Mirage Raceway) & Aeldra|r (EU-Proudmoore)
## Notes: Cast the most important buffs on you or party, raid, pets and assigned tanks. Use /sbm for options menu.
## DefaultState: Enabled
Expand Down
20 changes: 10 additions & 10 deletions localization.en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
SMARTBUFF_WHATSNEW = "\n\n|cffffffff Whats new:|r\n\n"
.." |cffffffffClassic version by Codermik\n"
.." Please report any issues on Curse or Discord.|r\n\n\n"
.." Changes in r38:\n\n"
.." * Addon now checks for Alchemy and adjusts the \n"
.." duration of pots, elixir's etc.\n\n"
.." * Added Dalaran Mage buffs. \n\n"
.." * Various other bug fixes. \n\n"
.."\n\n"
.." |c0000FF96Many thanks to Chris S. for his donation and\n"
.." supporting my addon development.\n\n"
.." Changes in r39:\n\n"
.." * Fixed LUA errors caused by recent API changes \n"
.." in client 30401.\n\n"
.." * Updated TOC to 30401. \n\n\n\n"
.." Note that this is a quick fix to get addon working,\n"
.." there are additional fixes incoming later today or\n"
.." tomorrow.. please be patient.\n"
.."\n"
.." |c0000FF96Many thanks to Chris S., Samantha R. and\n"
.." Twilight's Sundries for their kind donations.\n\n\n"
.." |cffffffffIf you appreciate my work on the various addons\n"
.." for wow then please consider supporting me, you\n"
.." can do this several ways which include:\n\n"
.." |cffffffffPatreon: |cff00e0ffhttps://www.patreon.com/codermik\n"
.." |cffffffffTwitch: |cff00e0ffhttps://www.twitch.tv/codermik\n"
.." |cffffffffPayPal.Me: |cff00e0ffhttps://paypal.me/codermik\n\n\n"
.." |cffffffffThanks to everyone providing feedback and\n"
.." |cffffffffbug reports - you have helped a lot!|r\n\n\n"

.." |cff00e0ffHuge thanks to Aeldra for creating the original\n"
.." addon and the framework for this working release.\n\n"
Expand Down

0 comments on commit a7e2618

Please sign in to comment.