Completely remove of engine-based visibility checks. This reduces CPU usage when bot searching for enemies.

This commit is contained in:
jeefo 2016-11-02 22:45:15 +03:00
commit 60556a0e4c
2 changed files with 2 additions and 29 deletions

View file

@ -5867,16 +5867,6 @@ bool Bot::OutOfBombTimer (void)
void Bot::ReactOnSound (void)
{
int hearEnemyIndex = -1;
#if 0
Vector pasOrg = EyePosition ();
if (pev->flags & FL_DUCKING)
pasOrg = pasOrg + (VEC_HULL_MIN - VEC_DUCK_HULL_MIN);
uint8 *pas = ENGINE_SET_PAS (reinterpret_cast <float *> (&pasOrg));
#endif
float minDistance = 99999.0f;
// loop through all enemy clients to check for hearable stuff
@ -5891,10 +5881,7 @@ void Bot::ReactOnSound (void)
if (distance > client.hearingDistance)
continue;
#if 0
if (!ENGINE_CHECK_VISIBILITY (client.ent, pas))
continue;
#endif
if (distance < minDistance)
{
hearEnemyIndex = i;

View file

@ -238,16 +238,6 @@ bool Bot::LookupEnemy (void)
// ignore shielded enemies, while we have real one
edict_t *shieldEnemy = nullptr;
#if 0
// setup potentially visible set for this bot
Vector potentialVisibility = EyePosition ();
if (pev->flags & FL_DUCKING)
potentialVisibility = potentialVisibility + (VEC_HULL_MIN - VEC_DUCK_HULL_MIN);
uint8 *pvs = ENGINE_SET_PVS (reinterpret_cast <float *> (&potentialVisibility));
#endif
// search the world for players...
for (int i = 0; i < engine.MaxClients (); i++)
{
@ -257,11 +247,7 @@ bool Bot::LookupEnemy (void)
continue;
player = client.ent;
#if 0
// let the engine check if this player is potentially visible
if (!ENGINE_CHECK_VISIBILITY (player, pvs))
continue;
#endif
// do some blind by smoke grenade
if (m_blindRecognizeTime < engine.Time () && IsBehindSmokeClouds (player))
{