Browse Source

Attack now work

hlzbot-dirty
Solexid 8 years ago committed by GitHub
parent
commit
9d0ede2439
  1. 26
      dlls/bot/cs_bot_vision.cpp

26
dlls/bot/cs_bot_vision.cpp

@ -687,33 +687,7 @@ CBasePlayer *CCSBot::FindMostDangerousThreat()
// is it an enemy? // is it an enemy?
//if (player->m_iTeam == m_iTeam) //if (player->m_iTeam == m_iTeam)
{ {
TraceResult result;
UTIL_TraceLine(GetEyePosition(), player->pev->origin, ignore_monsters, ignore_glass, edict(), &result);
if (result.flFraction == 1.0f)
{
// update watch timestamp
int idx = player->entindex() - 1;
m_watchInfo[idx].timestamp = gpGlobals->time;
m_watchInfo[idx].isEnemy = false;
// keep track of our closest friend
Vector to = pev->origin - player->pev->origin;
float rangeSq = to.LengthSquared();
if (rangeSq < closeFriendRange)
{
m_closestVisibleFriend = player;
closeFriendRange = rangeSq;
}
// keep track of our closest human friend
if (!player->IsBot() && rangeSq < closeHumanFriendRange)
{
m_closestVisibleHumanFriend = player;
closeHumanFriendRange = rangeSq;
}
}
continue;
} }
// check if this enemy is fully // check if this enemy is fully

Loading…
Cancel
Save