fix: refactoring mistake with square distances (ref #506 #495)

fix:  bot glibc dependency when SIMD is disabled
fakeping: allow to disable ping average ping calculation from human players (controllable via yb_count_players_for_fakeping)
This commit is contained in:
jeefo 2024-01-19 21:35:00 +03:00
commit d5a9253582
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
3 changed files with 39 additions and 34 deletions

View file

@ -627,7 +627,7 @@ bool Bot::isFriendInLineOfFire (float distance) {
}
const auto friendDistanceSq = client.ent->v.origin.distanceSq (pev->origin);
if (friendDistanceSq <= distanceSq && util.getShootingCone (ent (), client.ent->v.origin) > friendDistanceSq / (friendDistanceSq + cr::sqrf (1089.0f))) {
if (friendDistanceSq <= distanceSq && util.getShootingCone (ent (), client.ent->v.origin) > friendDistanceSq / (friendDistanceSq + cr::sqrf (33.0f))) {
return true;
}
}
@ -975,9 +975,6 @@ void Bot::fireWeapons () {
// or if friend in line of fire, stop this too but do not update shoot time
if (isFriendInLineOfFire (distance)) {
m_fightStyle = Fight::Strafe;
m_lastFightStyleCheck = game.time ();
return;
}
int selectId = Weapon::Knife, selectIndex = 0, choosenWeapon = 0;