fix: condition order for creatures in task filtering (resolves #583)

This commit is contained in:
jeefo 2024-06-04 22:58:21 +03:00
commit 3a026b1d4b
No known key found for this signature in database
GPG key ID: D696786B81B667C8

View file

@ -2028,6 +2028,9 @@ void Bot::filterTasks () {
const bool lowAmmo = isLowOnAmmo (m_currentWeapon, 0.18f);
const bool sniping = m_sniperStopTime > game.time () && lowAmmo;
if (m_isCreature) {
ratio = 0.0f;
}
if (bots.isBombPlanted () || m_isStuck || usesKnife ()) {
ratio /= 3.0f; // reduce the seek cover desire if bomb is planted
}
@ -2037,9 +2040,6 @@ void Bot::filterTasks () {
else if (m_lastEnemyOrigin.distanceSq2d (pev->origin) < cr::sqrf (200.0f)) {
ratio *= 3.0f;
}
else if (m_isCreature) {
ratio = 0.0f;
}
else if (game.is (GameFlags::CSDM)) {
ratio = 0.0f;
}