bot.cpp - from the line 3093:
Code:
if (!FNullEnt (pBot->pLastEnemy) && (pBot->bShootThruHeard)) // KWo - 13.07.2008
{
pBot->iAimFlags |= AIM_LASTENEMY;
pBot->iStates |= STATE_SUSPECTENEMY;
if ((pBot->f_bot_see_enemy_time + 1.0 < gpGlobals->time)
&& (pBot->fLastHeardEnOrgUpdateTime < gpGlobals->time)
&& (pBot->fLastSeenEnOrgUpdateTime < gpGlobals->time))
{
pBot->vecLastEnemyOrigin.x += RANDOM_FLOAT (-300.0, 300.0);
pBot->vecLastEnemyOrigin.y += RANDOM_FLOAT (-300.0, 300.0);
pBot->fLastHeardEnOrgUpdateTime = gpGlobals->time + 1.0;
}
}
If the enemy is "shootable" through the obstacle, every 1 second his position is somehow estimated (he cannot know exactly where the enemy is). As You can see it affects x and y only - so he shouldn't shoot into the sky...