Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the playerbot item-selection logic so bots will prefer consuming “buff food” (Well Fed-style foods) when available, and fall back to regular food otherwise.
Changes:
- Add a new
"buff food"inventory query and visitor to find buff foods in bags. - Update
EatActionto try buff food first (when not already buffed), then fall back to existing food behavior. - Add helper logic to detect buff-food items and whether the bot already has a relevant food buff.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/modules/Bots/playerbot/strategy/actions/NonCombatActions.h |
Tries buff food before normal food during eating. |
src/modules/Bots/playerbot/strategy/actions/InventoryAction.cpp |
Adds parsing support for "buff food" inventory queries. |
src/modules/Bots/playerbot/strategy/ItemVisitors.h |
Introduces buff-food detection helpers and a FindBuffFoodVisitor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| SpellEntry const* sp = sSpellStore.LookupEntry(proto->Spells[0].SpellId); | ||
| return sp && ((sp->AttributesEx2 & SPELL_ATTR_EX2_FOOD_BUFF) || sp->Effect[1] != 0 || sp->Effect[2] != 0); |
There was a problem hiding this comment.
Those effect indexes were what I found used in the actual game with actual buff food, and which does not match non-buff food. I think Copilot is off here, but shrug.
| if (bot->HasAura(sp->Id)) | ||
| return true; | ||
| for (int i = 1; i < MAX_EFFECT_INDEX; ++i) | ||
| { | ||
| uint32 triggerSpell = sp->EffectTriggerSpell[i]; | ||
| if (triggerSpell && bot->HasAura(triggerSpell)) | ||
| return true; |
There was a problem hiding this comment.
Same comment as before.
| #include "DBCStore.h" | ||
| #include "DBCStores.h" | ||
|
|
| bool result = false; | ||
| list<Item*> buffFoods = AI_VALUE2(list<Item*>, "inventory items", "buff food"); | ||
| if (!buffFoods.empty() && !HasFoodBuff(bot, buffFoods)) | ||
| result = UseItemAuto(*buffFoods.begin()); |
There was a problem hiding this comment.
If Copilot is not hallucinating here, then this is a good change. It's true that I did not make any assumptions about what might be listed as a buff spell for buff food like Copilot is here. This means that I'm ONLY preventing a bot from re-applying the same buff food spell as it currently knows about from its own inventory.
Allows bots to prefer buff food when available, and regular food when not.
This change is