Skip to content

Fix for Bot Aura Checks#272

Merged
billy1arm merged 1 commit intomangoszero:masterfrom
bozimmerman:bot_aura_check_bugfix
Mar 16, 2026
Merged

Fix for Bot Aura Checks#272
billy1arm merged 1 commit intomangoszero:masterfrom
bozimmerman:bot_aura_check_bugfix

Conversation

@bozimmerman
Copy link
Contributor

@bozimmerman bozimmerman commented Mar 16, 2026

This fixes a bug where the code wants to know if a spell has already been cast on someone, but doesn't consider that many buffs come in multiple ranks with different ids. The fix is to fall back to the spells string name, which will cover all the ranks.

In particular, this fixed an infinite buffing contest between two mage playerbots with different ranks of Intellect.


This change is Reviewable

Copilot AI review requested due to automatic review settings March 16, 2026 01:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes bot aura/buff checks so they recognize buffs that exist in multiple spell ranks (different spell IDs) by falling back to aura name matching when an exact spell-id match isn’t found, preventing repeated re-buffing loops (e.g., two mage bots with different Arcane Intellect ranks).

Changes:

  • Update PlayerbotAI::HasAura(string, Unit*) to only early-return on a spell-id lookup when the exact spell-id aura is present.
  • Allow the function to continue to the name-based aura scan when the spell-id rank is not found.

💡 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.

Comment on lines 1010 to 1014
uint32 spellId = aiObjectContext->GetValue<uint32>("spell id", name)->Get();
if (spellId)
if (spellId && HasAura(spellId, unit))
{
return HasAura(spellId, unit);
return true;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had no idea that was even a thing- dang. Yea, if that actually exists, it would be better.

Copy link
Contributor Author

@bozimmerman bozimmerman Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, after thinking about it -- I will have to stand by my original commit and just let the maintainers decide, but here's what I think:

First off, this was a bug fix to enable behavior that was already clearly intended, due to the entire rest of the method handling the name-search. So, this commit is a minimal fix and less risky than Copilot's suggestion.

Second, while Copilot's solution WOULD speed up my weird use-case, it would not matter in all other cases, including the most common case of all: an aura missing entirely. When the aura is missing entirely, it would STILL fall back to the name search in Copilot's code. So, on net: the speed benefit is likely to be very minor.

So, my humble suggestion: take this bug fix in that spirit, and consider Copilot's change as a minor optimization later.

@AppVeyorBot
Copy link

@bozimmerman bozimmerman reopened this Mar 16, 2026
@AppVeyorBot
Copy link

@billy1arm billy1arm merged commit ac4cfad into mangoszero:master Mar 16, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants