HgAlexx / Buffet

Buffet is a food/water macro generator originally developed by tekkub and currently maintained by mZHg.
https://www.curseforge.com/wow/addons/buffet
15 stars 8 forks source link

"Third Wind" Potion selected for Consumables even when not in a usable battleground #18

Closed vttale closed 3 years ago

vttale commented 3 years ago

The bug: The "Third Wind" Potion will always show up in the Consumables macro even when it is not in a usable area. You can use them in regular battlegrounds and brawls, but not in any other PvE or PvP setting (arenas, rated BGs, open world warmode, etc).

Buffet: Item ["Third Wind" Potion]: Buffet: - Is health: Yes Buffet: - Is mana: No Buffet: - Is well fed: No Buffet: - Is conjured: No Buffet: - Is percent: Yes Buffet: - Is potion: Yes Buffet: - Is bandage: No Buffet: - Is over time: No Buffet: - Is restricted: No Buffet: - health value: 50% (20550 hp) Buffet: - mana value: 0% (0 mp) Buffet: - itemClassId: 0 Buffet: - itemSubClassId: 1

To Reproduce Have the Third Wind Potion in your bag but not a warlock healthstone because the latter is thankfully selected preferentially. I'm not sure what other items might take priority over it, but I know that when I have Third Wind and regular health potions in my bag, the Third Wind one is the one that is selected even when not usable.

Related Item https://www.wowhead.com/item=138486/third-wind-potion

Language enUS

HgAlexx commented 3 years ago

Hello,

I can restrict it to all BGs but I'm not sure about rated ones. Also, what do you mean by brawls?

Can you try something ?

Edit the following file: "Buffet/Retail/ConstRetail.lua"

Go to the end and add this before the last "}":

    [138486] = { -- Third wind potion
        inInstanceTypes = { "pvp" },
    },

This will restrict the potion to all BGs, excluding arena, no idea regarding rated.

If this works, I'll do a release with it.

vttale commented 3 years ago

Brawls are basically just unrated BGs that have special rulesets from their regular versions. AFAIK you can use anything in them that you can use in a regular unrated BG, so no real reason to distinguish them.

Rated vs unrated matters a lot though. There's a ton of items you can't use in rated BGs or arenas. Looks like "C_PvP.IsRatedBattleground() or C_PvP.IsArena()" would be an easy way to deal with it.

HgAlexx commented 3 years ago

Thanks, I'll have a look at that ;)

HgAlexx commented 3 years ago

Does this look ok to you ? pvp = { bg = true, arena = false, brawl = true, ratedBg = false, ratedArena = false }

HgAlexx commented 3 years ago

I built a new Beta, can you try it ?

https://www.curseforge.com/wow/addons/buffet/files/3209186

vttale commented 3 years ago

Hmm, just jumped into a brawl to try with your beta. C_PvP.IsBattleground() is true, C_PcP.IsInBrawl() is true, and C_PvP.IsRatedBattleground() is false. The potion stack that is in my bag should show for Consumables, but instead it is showing Spiritual Healing Potion.

On the plus side, the Third Wind potion is no longer taking unusable precedence in PvE.

HgAlexx commented 3 years ago

Does 50% of your health is greater than what Spiritual Healing Potion give you ? Maybe it's just because of the return health of each potion.

HgAlexx commented 3 years ago

you can use /buffet debug [item link] to check each item for their health values

HgAlexx commented 3 years ago

Nevermind, I know the issue, it's my bad :)

Change ConstRetail to match this:

    [138486] = { -- Third wind potion
        {
            matchMode = "any",
            pvp = { bg = true, brawl = true }
        },
    },
HgAlexx commented 3 years ago

Should be fix in last beta (v73)