nav: give bots with move task higher priority when avoiding each other

This commit is contained in:
jeefo 2025-01-25 22:24:18 +03:00
commit 582beb0978
No known key found for this signature in database
GPG key ID: D696786B81B667C8

View file

@ -1313,10 +1313,10 @@ int BotManager::getPlayerPriority (edict_t *ent) {
if (bot->m_hasC4 || bot->m_isVIP || bot->m_hasHostage || bot->m_healthValue < ent->v.health || (bot->m_currentTravelFlags & PathFlag::Jump)) {
return bot->entindex () + kHighPriority;
}
auto task = bot->getCurrentTaskId ();
const auto task = bot->getCurrentTaskId ();
// higher priority if camping or hiding
if (task == Task::Camp || task == Task::Hide) {
if (task == Task::Camp || task == Task::Hide || task == Task::MoveToPosition) {
return bot->entindex () + kHighPriority;
}
return bot->entindex ();