Skip to content

Commit

Permalink
fix: condition order for creatures in task filtering (resolves #583)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeefo committed Jun 4, 2024
1 parent 61036ec commit 3a026b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/botlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 3a026b1

Please sign in to comment.