[Bots] Add attack flag when told to attack (#4490)

This adds a flag to mobs that are told to attack by their owner to prevent unintended attacks.

Previously, if you were to send your bots to attack a target and then switch targets: before casters land their spell or if melee (especially anyone with pets)  hasn't engaged before the target switch, they could switch to your new target and attack.

This adds a flag upon attack and bots will only attack flagged targets.
This commit is contained in:
nytmyr
2024-09-29 16:59:26 -05:00
committed by GitHub
parent 8d23e710ce
commit 56608e84bd
5 changed files with 48 additions and 2 deletions
+5
View File
@@ -799,6 +799,11 @@ bool NPC::Process()
}
}
if (bot_attack_flag_timer.Check()) {
bot_attack_flag_timer.Disable();
ClearBotAttackFlags();
}
AI_Process();
return true;