Prevent bots attacking dummy Targets at the Argent Tournament Grounds

There was existing code to ignore practice targets (anything with Dummy in the name) so I've just added the names of practice targets located in the tournament grounds:

Charge Target
Melee Target
Ranged Target

I considered just using the phrase "Target", but it is too generic and there are 246 creature_template names containing Target.
This commit is contained in:
avirar
2024-12-17 12:35:49 +11:00
committed by GitHub
parent 418a0c4be2
commit 649e55dd84

View File

@@ -49,8 +49,15 @@ bool AttackAnythingAction::isUseful()
return false; return false;
std::string const name = std::string(target->GetName()); std::string const name = std::string(target->GetName());
if (!name.empty() && name.find("Dummy") != std::string::npos) // Target is not a targetdummy // Check for invalid targets: Dummy, Charge Target, Melee Target, Ranged Target
return false; if (!name.empty() &&
(name.find("Dummy") != std::string::npos ||
name.find("Charge Target") != std::string::npos ||
name.find("Melee Target") != std::string::npos ||
name.find("Ranged Target") != std::string::npos))
{
return false; // Target is one of the disallowed types
}
// if (!ChooseRpgTargetAction::isFollowValid(bot, target)) //Do not grind mobs far // if (!ChooseRpgTargetAction::isFollowValid(bot, target)) //Do not grind mobs far
// away from master. // away from master.