[Battlegrounds] fixed bug I introduced in PR#422 where bots alternate mount/unmount near flag indefinately, also fixed other erroneous uses of sqrt on distances

This commit is contained in:
Fuzz
2024-08-08 21:18:52 +10:00
parent c0836c26e6
commit f1bfed190c
5 changed files with 56 additions and 59 deletions

View File

@@ -294,7 +294,7 @@ bool ChooseRpgTargetAction::isFollowValid(Player* bot, WorldPosition pos)
if (!botAI->HasStrategy("follow", BOT_STATE_NON_COMBAT))
return true;
if (sqrt(bot->GetDistance(master)) > sPlayerbotAIConfig->rpgDistance * 2)
if (bot->GetDistance(master) > sPlayerbotAIConfig->rpgDistance * 2)
return false;
Formation* formation = AI_VALUE(Formation*, "formation");