fix: resolve some chatter overuse reported in #555

Co-Authored-By: Max <161382234+dyspose@users.noreply.github.com>
This commit is contained in:
jeefo 2024-04-17 21:36:39 +03:00
commit 9ce8913c2c
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
3 changed files with 7 additions and 7 deletions

View file

@ -609,7 +609,7 @@ void Bot::updatePickups () {
// decide to duck or not to duck // decide to duck or not to duck
selectCampButtons (index); selectCampButtons (index);
if (rg.chance (90)) { if (rg.chance (85) && numEnemiesNear (pev->origin, 768.0f) < 4) {
pushChatterMessage (Chatter::DefendingBombsite); pushChatterMessage (Chatter::DefendingBombsite);
} }
} }

View file

@ -1110,7 +1110,7 @@ void Bot::fireWeapons () {
m_reloadState = Reload::Primary; m_reloadState = Reload::Primary;
m_reloadCheckTime = game.time (); m_reloadCheckTime = game.time ();
if (rg.chance (cr::abs (m_difficulty * 25 - 100)) && rg.chance (20)) { if (rg.chance (cr::abs (m_difficulty * 25 - 100)) && rg.chance (25)) {
pushRadioMessage (Radio::NeedBackup); pushRadioMessage (Radio::NeedBackup);
} }
} }

View file

@ -835,7 +835,7 @@ void Bot::plantBomb_ () {
completeTask (); completeTask ();
// tell teammates to move over here... // tell teammates to move over here...
if (numFriendsNear (pev->origin, 1200.0f) != 0) { if (numFriendsNear (pev->origin, 1200.0f) > 0) {
pushRadioMessage (Radio::NeedBackup); pushRadioMessage (Radio::NeedBackup);
} }
const auto index = findDefendNode (pev->origin); const auto index = findDefendNode (pev->origin);
@ -906,7 +906,7 @@ void Bot::defuseBomb_ () {
defuseError = false; defuseError = false;
} }
if (m_numFriendsLeft > friends) { if (m_numEnemiesLeft > 0 && m_numFriendsLeft > friends) {
pushRadioMessage (Radio::NeedBackup); pushRadioMessage (Radio::NeedBackup);
} }
} }
@ -1018,10 +1018,10 @@ void Bot::defuseBomb_ () {
m_strafeSpeed = 0.0f; m_strafeSpeed = 0.0f;
// notify team // notify team
if (m_numFriendsLeft != 0) { if (m_numFriendsLeft > 0) {
pushChatterMessage (Chatter::DefusingBomb); pushChatterMessage (Chatter::DefusingBomb);
if (numFriendsNear (pev->origin, 512.0f) < 2) { if (m_numEnemiesLeft > 0 && numFriendsNear (pev->origin, 512.0f) < 2) {
pushRadioMessage (Radio::NeedBackup); pushRadioMessage (Radio::NeedBackup);
} }
} }
@ -1574,7 +1574,7 @@ void Bot::pickupItem_ () {
pushChatterMessage (Chatter::DefusingBomb); pushChatterMessage (Chatter::DefusingBomb);
// notify team of defusing // notify team of defusing
if (m_numFriendsLeft < 3) { if (m_numEnemiesLeft > 0 && m_numFriendsLeft < 3 && rg.chance (90)) {
pushRadioMessage (Radio::NeedBackup); pushRadioMessage (Radio::NeedBackup);
} }
m_moveToGoal = false; m_moveToGoal = false;