- Added skipping disperse tactic while bot is in stay stance (#1180)

This commit is contained in:
kadeshar
2025-04-08 14:55:07 +02:00
committed by GitHub
parent 3f52563ca7
commit fe519854a4

View File

@@ -2232,7 +2232,9 @@ bool CombatFormationMoveAction::isUseful()
bool CombatFormationMoveAction::Execute(Event event)
{
float dis = AI_VALUE(float, "disperse distance");
if (dis <= 0.0f)
if (dis <= 0.0f ||
(!bot->IsInCombat() && botAI->HasStrategy("stay", BotState::BOT_STATE_NON_COMBAT)) ||
(bot->IsInCombat() && botAI->HasStrategy("stay", BotState::BOT_STATE_COMBAT)))
return false;
Player* playerToLeave = NearestGroupMember(dis);
if (playerToLeave && bot->GetExactDist(playerToLeave) < dis)