Menu

#55 lua error after patch

Patched
HonorGoG
None
Classic
Medium
Defect
2023-08-23
2023-01-18
Urok
No

lua error when taking a portal from one city to another.

Message: ...terface/AddOns/TitanClassicAmmo/TitanClassicAmmo.lua:125: Usage: GetItemInfo(itemID|"name"|"itemlink")
Time: Wed Jan 18 16:30:33 2023
Count: 2
Stack: ...terface/AddOns/TitanClassicAmmo/TitanClassicAmmo.lua:125: Usage: GetItemInfo(itemID|"name"|"itemlink")
[string "=[C]"]: in function GetItemInfo' [string "@Interface/AddOns/TitanClassicAmmo/TitanClassicAmmo.lua"]:125: in function <...terface/AddOns/TitanClassicAmmo/TitanClassicAmmo.lua:109> [string "@Interface/AddOns/TitanClassicAmmo/TitanClassicAmmo.lua"]:233: in functionTitanPanelAmmoUpdateDisplay'
[string "@Interface/AddOns/TitanClassicAmmo/TitanClassicAmmo.lua"]:217: in function `TitanPanelAmmoButton_MERCHANT_CLOSED'
[string "@Interface/AddOns/TitanClassicAmmo/TitanClassicAmmo.lua"]:175: in function <...terface/AddOns/TitanClassicAmmo/TitanClassicAmmo.lua:167>

Locals:

Discussion

  • phobomancer

    phobomancer - 2023-02-11

    it looks like GetInventoryItemID() is returning nil immediately after zoning into a new location and GetItemInfo() throws an exception when fed the nil value

    i found i just needed to change modify the else block in question to the following:

        else
    
            ammo_id = GetInventoryItemID("player",ammoSlotID)
    
            if ammo_id ~= nil then
                ammo_name = select(1, GetItemInfo(ammo_id))) or _G["UNKNOWN"]
            else
                ammo_name = _G["UNKNOWN"]
            end 
    
            if ammo_name == _G["UNKNOWN"] then
                ammo_count = 0
            else
                ammo_count = GetInventoryItemCount("player", ammoSlotID) or ammo_count
            end
        end
    

    i hope this helps :)

     

    Last edit: phobomancer 2023-02-11
    • HonorGoG

      HonorGoG - 2023-02-12

      I actually released 1.5.5.30401 this afternoon before seeing this. I'm hoping that the nil from the slot is caused by triggering on PLAYER_LOGIN which happens very early so I changed it to trigger on PLAYER_ENTERING_WORLD. If that still doesn't resolve it, I will certainly incorporate your change. Thank you.

       
  • HonorGoG

    HonorGoG - 2023-08-23
    • status: New --> Patched
    • assigned_to: HonorGoG
     
  • HonorGoG

    HonorGoG - 2023-08-23

    Patched in 1.5.6 release.

     

Log in to post a comment.

MongoDB Logo MongoDB