[Battlegrounds] fix for #424 - flag carrier not fighting back when enemy has flag too and bot is hiding

This commit is contained in:
Fuzz
2024-08-07 23:40:19 +10:00
parent 45ebef049f
commit 27c5d6b19c
5 changed files with 59 additions and 24 deletions

View File

@@ -44,13 +44,12 @@ bool EnterVehicleAction::Execute(Event event)
if (vehicleBase->GetVehicleKit()->IsVehicleInUse())
continue;
// if (fabs(bot->GetPositionZ() - vehicleBase->GetPositionZ()) < 20.0f)
float dist = sServerFacade->GetDistance2d(bot, vehicleBase);
if (dist > 40.0f)
continue;
// if (sServerFacade->GetDistance2d(bot, vehicle) > 100.0f)
// continue;
if (sServerFacade->GetDistance2d(bot, vehicleBase) > INTERACTION_DISTANCE)
return MoveTo(vehicleBase, INTERACTION_DISTANCE - 1.0f);
if (dist > INTERACTION_DISTANCE)
return MoveTo(vehicleBase);
bot->EnterVehicle(vehicleBase);