fix: bots use buttons too extensively

nav: added more cpu-friendly version to check if bot will fall in combat
This commit is contained in:
jeefo 2024-03-11 15:26:11 +03:00
commit 6e09cee0ee
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
6 changed files with 54 additions and 37 deletions

View file

@ -1962,12 +1962,7 @@ void Bot::filterTasks () {
filter[Task::PickupItem].desire = 50.0f; // always pickup button
}
else {
float distance = (500.0f - pev->origin.distance (game.getEntityOrigin (m_pickupItem))) * 0.2f;
if (distance > 50.0f) {
distance = 50.0f;
}
filter[Task::PickupItem].desire = distance;
filter[Task::PickupItem].desire = cr::max (50.0f, 500.0f - pev->origin.distance (game.getEntityOrigin (m_pickupItem)) * 0.2f);
}
}
else {