bad argument #1 to 'GetItemID'
b-morgan opened this issue ยท 7 comments
Running Software (issues missing this information will be deleted):
- Addon version: 10.0.2
- Server patch: 3.4.0.46248
Have you read the changelog? (please don't waste our time)
Yes
Describe the bug
Numerous GetItemID lua errors.
To Reproduce
Steps to reproduce the behaviour:
- Open bags, bank, guild bank
- See error
Expected behaviour
No errors when bags, bank, or guild bank is opened.
Screenshots
N/A
Error Logs
Type /console scriptErrors 1
in the chat and reload the game. If an error window appears, write here the message with ID: 1
(labelled 1/X). This is generally NOT the message that the window shows by default.
Additional context
28x Scrap\addons\main\main.lua:223: bad argument #1 to 'GetItemID' (Usage: local itemID = C_Item.GetItemID(itemLocation))
[string "=[C]"]: in function GetItemID' [string "@Scrap\addons\main\main.lua"]:223: in function
GuessLocation'
[string "@scrap\addons\main\main.lua"]:142: in function IsFiltered' [string "@Scrap\addons\main\main.lua"]:85: in function
IsJunk'
[string "@Bagnon_Scrap\Bagnon_Scrap-8.3.0.lua"]:42: in function ?' [string "@Bagnon\common\Wildpants\classes\itemGroup.lua"]:183: in function
ForAll'
[string "@bagnon\common\Wildpants\classes\itemGroup.lua"]:102: in function ?' [string "@Questie\Libs\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:119: in function <...tie\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:119> [string "=[C]"]: ? [string "@Questie\Libs\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:29: in function <...tie\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:25> [string "@Questie\Libs\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:64: in function
Fire'
[string "@Questie\Libs\AceEvent-3.0\AceEvent-3.0-4.lua"]:120: in function <...ceQuestie\Libs\AceEvent-3.0\AceEvent-3.0.lua:119>
Felcrystal Impaler
(Mythic) from Hellfire Citadel is one of the items causing this error
I already noticed previously (before the latest patch) that range weapons are never marked as junk (on my non-ranged character at least) - so maybe something broke now
You can notice that items which would normally be marked as junk are not marked as such if the bugged item is placed after them
This error occurs most often when something is "used up" in my bags. For example, cooking things causes the error when the last raw food is cooked. Opening the guild bank also generates lots of these errors so there's more than one cause.
The change from @Kirri777 fixes the issue for me
It happened again with another range weapon on my warrior - Kor'kron Hand Cannon
(Mythic)
(Still doesn't get marked as junk though)
I repaired my error.
Need change /AddOns/Scrap/addons/main/main.lua:
function Scrap:IsBetterEquip(slot, level, canEmpty)
local item = ItemLocation:CreateFromEquipmentSlot(_G[slot])
if C_Item.GetItemID(item) then
return (C_Item.GetCurrentItemLevel(item) or 0) >= (level * 1.3)
elseif canEmpty then
return true
end
end
to
function Scrap:IsBetterEquip(slot, level, canEmpty)
local item = ItemLocation:CreateFromEquipmentSlot(_G[slot])
if item:IsValid() then
if C_Item.GetItemID(item) then
return (C_Item.GetCurrentItemLevel(item) or 0) >= (level * 1.3)
elseif canEmpty then
return true
end
end
return false
end
I have the same error
Message: Interface/AddOns/Scrap/addons/main/main.lua:209: bad argument #1 to 'GetItemID' (Usage: local itemID = C_Item.GetItemID(itemLocation))
Time: Sun Oct 30 04:07:58 2022
Count: 3
Stack: Interface/AddOns/Scrap/addons/main/main.lua:209: bad argument #1 to 'GetItemID' (Usage: local itemID = C_Item.GetItemID(itemLocation))
[string "@Interface/AddOns/TradeSkillMaster/LibTSM/Service/ErrorHandler.lua"]:761: in function <...Ons/TradeSkillMaster/LibTSM/Service/ErrorHandler.lua:717>
[string "=(tail call)"]: ?
[string "=[C]"]: in function `GetItemID'
[string "@Interface/AddOns/Scrap/addons/main/main.lua"]:209: in function `IsBetterEquip'
[string "@Interface/AddOns/Scrap/addons/main/main.lua"]:203: in function `IsLowEquip'
[string "@Interface/AddOns/Scrap/addons/main/main.lua"]:158: in function `IsFiltered'
[string "@Interface/AddOns/Scrap/addons/main/main.lua"]:85: in function `IsJunk'
[string "@Interface/AddOns/Scrap/addons/main/main.lua"]:117: in function `(for generator)'
[string "@Interface/AddOns/Scrap/addons/merchant/button.lua"]:229: in function `GetReport'
[string "@Interface/AddOns/Scrap/addons/merchant/button.lua"]:193: in function `Sell'
[string "@Interface/AddOns/Scrap/addons/merchant/button.lua"]:60: in function `?'
[string "@Interface/AddOns/AllTheThings/lib/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:119: in function <...ings/lib/CallbackHandler-1.0/CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Interface/AddOns/AllTheThings/lib/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:29: in function <...ings/lib/CallbackHandler-1.0/CallbackHandler-1.0.lua:25>
[string "@Interface/AddOns/AllTheThings/lib/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:64: in function `SendMessage'
[string "@Interface/AddOns/Scrap/libs/WildAddon-1.0/WildAddon-1.0.lua"]:83: in function `SendSignal'
[string "@Interface/AddOns/Scrap/addons/main/main.lua"]:56: in function <Interface/AddOns/Scrap/addons/main/main.lua:56>
[string "=[C]"]: ?
[string "@Interface/AddOns/AllTheThings/lib/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:29: in function <...ings/lib/CallbackHandler-1.0/CallbackHandler-1.0.lua:25>
[string "@Interface/AddOns/AllTheThings/lib/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:64: in function `Fire'
[string "@Interface/AddOns/ElvUI/Libraries/Core/Ace/AceEvent-3.0/AceEvent-3.0.lua"]:120: in function <...vUI/Libraries/Core/Ace/AceEvent-3.0/AceEvent-3.0.lua:119>
Locals: <none>
The change from @Kirri777 fixes the issue for me
It happened again with another range weapon on my warrior -
Kor'kron Hand Cannon
(Mythic) (Still doesn't get marked as junk though)
For autosell weapons I used aardvark addon