added 'move from group' action/strat/shortcut-action

This commit is contained in:
Fuzz
2024-08-26 22:30:36 +10:00
parent 1aa9145902
commit d29569e9ea
14 changed files with 180 additions and 19 deletions

View File

@@ -48,15 +48,19 @@ bool FollowAction::Execute(Event event)
bool FollowAction::isUseful()
{
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr)
{
// move from group takes priority over follow as it's added and removed automatically
// (without removing/adding follow)
if (botAI->HasStrategy("move from group", BOT_STATE_COMBAT) ||
botAI->HasStrategy("move from group", BOT_STATE_NON_COMBAT))
return false;
}
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr)
return false;
Formation* formation = AI_VALUE(Formation*, "formation");
if (!formation)
{
return false;
}
std::string const target = formation->GetTargetName();
Unit* fTarget = nullptr;