BagSync

BagSync

3M Downloads

Lua error when crafting (cooking)

b-morgan opened this issue ยท 3 comments

commented

While crafting 2 Brilliant Smallfish using Skillet-Classic-5.00-alpha15, I get the following error as each item is created. BagSync is version 17.3. This is on a level 10 toon who has not purchased the Reagent Bank.

2x Interface/AddOns/BagSync/wireframe/scanner.lua:773: attempt to index field '?' (a nil value)
[string "@Interface/AddOns/BagSync/wireframe/scanner.lua"]:773: in function SaveCraftedReagents' [string "@Interface/AddOns/BagSync/wireframe/events.lua"]:248: in function func'
[string "@Interface/AddOns/BagSync/libs/AceTimer-3.0-17/AceTimer-3.0.lua"]:57: in function <...ce/AddOns/BagSync/libs/AceTimer-3.0/AceTimer-3.0.lua:50>

Locals:
self =

{
IsKeyring = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:67
SetDefaultModuleLibraries = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:363
Enable = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:290
NewModule = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:231
GetBagSlots = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:41
modules =
{
}
GetModule = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:206
IterateEmbeds = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:438
SaveReagents = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:166
defaultModuleLibraries =
{
}
SaveBank = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:149
CleanupProfessions = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:603
SetDefaultModulePrototype = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:405
StartupScans = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:84
name = "BagSync_Scanner"
invertedRecipeIDs =
{
}
IsEnabled = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:447
orderedModules =
{
}
DisableModule = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:346
IsBackpackBag = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:62
IsBank = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:71
reagentCount =
{
}
IsBackpack = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:58
SaveCraftedReagents = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:661
baseName = "BagSync"
recipeIDs =
{
}
IsBankBag = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:75
IsModule = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:213
GetXRGuild = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:192
SetDefaultModuleState = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:383
SaveProfessions = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:441
IsReagentBag = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:80
SetEnabledState = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:420
GetName = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:275
enabledState = true
SaveVoidBank = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:174
SaveGuildBank = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:211
SaveBag = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:102
SaveAuctionHouse = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:307
ParseCraftedInfo = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:627
SaveEquipment = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:133
IterateModules = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:433
SaveMailbox = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:258
EnableModule = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:328
SaveCurrency = defined @Interface/AddOns/BagSync/wireframe/scanner.lua:390
moduleName = "Scanner"
defaultModuleState = true
Disable = defined @Interface/AddOns/BagSync/libs/AceAddon-3.0/AceAddon-3.0.lua:310
}
bagtype = "reagents"
rootItems =
{
1 = "10939;6"
2 = "10938;16"
3 = "10940;36"
4 = "2842"
5 = "2319;10"
6 = "2318;9"
7 = "2592;10"
8 = "2589;21"
9 = "818;2"
10 = "774"
11 = "2555"
12 = "17056;20"
}
slotItems =
{
1 = "10939;6"
2 = "10938;16"
3 = "10940;36"
4 = "2842"
5 = "2319;10"
6 = "2318;9"
7 = "2592;10"
8 = "2589;

commented

Here is a patch that should fix the issue (move the 4 lines after the if IsReagentBankUnlocked() then to before it):

--- D:/World of Warcraft/_retail_/Interface/AddOns/BagSync/wireframe/scanner.old.lua	Wed Nov 16 07:24:11 2022
+++ D:/World of Warcraft/_retail_/Interface/AddOns/BagSync/wireframe/scanner.lua	Fri Nov 18 12:45:33 2022
@@ -698,11 +698,11 @@
 	end
 	
 	--REAGENTS
+	bagtype = "reagents"
+	
+	if not BSYC.db.player[bagtype] then BSYC.db.player[bagtype] = {} end
+	
 	if IsReagentBankUnlocked() then
-		bagtype = "reagents"
-		
-		if not BSYC.db.player[bagtype] then BSYC.db.player[bagtype] = {} end
-		
 		for bagID, bagData in pairs(BSYC.db.player[bagtype]) do
 		
 			slotItems = {}
commented

Thank you! That is very kind of you. I'll take a look at the bug and your fix. There is another bug report someone filled actually in regards to this reagent scanner when crafting. I may have to rework some of it due to some changes to how GetItemInfo() interacts with bank/reagents. There is also a calculation issue with items already in bags.

So it may be a twofold issue and you found one of the problems :)

commented

Okay so this bug seems to occur because of the secondary Reagent parsing. There is no check for RegeantBank unlock there. I will add it to prevent the error from happening again.