diff --git a/src/strategy/actions/BattleGroundTactics.cpp b/src/strategy/actions/BattleGroundTactics.cpp index 4c9ad122..e3fadd49 100644 --- a/src/strategy/actions/BattleGroundTactics.cpp +++ b/src/strategy/actions/BattleGroundTactics.cpp @@ -4410,11 +4410,11 @@ bool BGTactics::moveToObjective() //std::ostringstream out; out << "Moving to objective " << pos.x << ", " << pos.y << ", Distance: " << sServerFacade->GetDistance2d(bot, pos.x, pos.y); //bot->Say(out.str(), LANG_UNIVERSAL); - // more precise position for wsg and AV (flags in AV towers require precision) - if (bgType == BATTLEGROUND_WS || bgType == BATTLEGROUND_AV) + // more precise position for wsg + if (bgType == BATTLEGROUND_WS) return MoveTo(bot->GetMapId(), pos.x, pos.y, pos.z); else - return MoveNear(bot->GetMapId(), pos.x, pos.y, pos.z, 3.0f); + return MoveNear(bot->GetMapId(), pos.x, pos.y, pos.z, 1.5f);//note - don't make distance too large or horde bots may struggle to get flags in alliance AV towers (because they'll be targetting a spot in midair) } return false; } @@ -4774,9 +4774,9 @@ bool BGTactics::atFlag(std::vector const& vPaths, std::vectorCanUseBattlegroundObject(go) && bgType != BATTLEGROUND_WS) continue; - if (flagRange) - if (!bot->IsWithinDistInMap(go, flagRange)) - continue; + float const dist = sqrt(bot->GetDistance(go)); + if (flagRange && dist > flagRange) + continue; bool atBase = bgType == BATTLEGROUND_WS ? go->GetEntry() == vFlagsWS[bot->GetTeamId()] : bgType == BATTLEGROUND_EY ? go->GetEntry() == vFlagsEY[0] : false; @@ -4789,6 +4789,13 @@ bool BGTactics::atFlag(std::vector const& vPaths, std::vectorGetObjectSize() + go->GetObjectSize() + 0.1f; + return MoveTo(bot->GetMapId(), go->GetPositionX() + (urand(0, 1) ? -moveDist : moveDist), go->GetPositionY() + (urand(0, 1) ? -moveDist : moveDist), go->GetPositionZ()); + } if (bot->IsMounted()) bot->RemoveAurasByType(SPELL_AURA_MOUNTED);