refactor: remove ignore fov parameter from enemy see check

This commit is contained in:
jeefo 2023-06-27 09:45:04 +03:00
commit aef3ff0b36
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
2 changed files with 3 additions and 3 deletions

View file

@ -417,7 +417,7 @@ private:
bool isWeaponRestrictedAMX (int weaponIndex); bool isWeaponRestrictedAMX (int weaponIndex);
bool isInViewCone (const Vector &origin); bool isInViewCone (const Vector &origin);
bool checkBodyParts (edict_t *target); bool checkBodyParts (edict_t *target);
bool seesEnemy (edict_t *player, bool ignoreFOV = false); bool seesEnemy (edict_t *player);
bool hasActiveGoal (); bool hasActiveGoal ();
bool advanceMovement (); bool advanceMovement ();
bool isBombDefusing (const Vector &bombOrigin); bool isBombDefusing (const Vector &bombOrigin);

View file

@ -207,12 +207,12 @@ bool Bot::checkBodyParts (edict_t *target) {
return false; return false;
} }
bool Bot::seesEnemy (edict_t *player, bool ignoreFOV) { bool Bot::seesEnemy (edict_t *player) {
if (game.isNullEntity (player)) { if (game.isNullEntity (player)) {
return false; return false;
} }
if ((ignoreFOV || isInViewCone (player->v.origin)) && isEnemyInFrustum (player) && checkBodyParts (player)) { if (isEnemyInFrustum (player) && isInViewCone (player->v.origin) && checkBodyParts (player)) {
m_seeEnemyTime = game.time (); m_seeEnemyTime = game.time ();
m_lastEnemy = player; m_lastEnemy = player;
m_lastEnemyOrigin = m_enemyOrigin; m_lastEnemyOrigin = m_enemyOrigin;