Bot vision update.

* Bots can't see invisible enemies
* Bots ignore enemies with flag FL_NOTARGET
This commit is contained in:
Vaqtincha 2018-10-31 00:08:05 +05:00 committed by Dmitry Novikov
parent 30c3586580
commit 932001b591

View File

@ -249,6 +249,11 @@ bool CCSBot::IsVisible(const Vector *pos, bool testFOV) const
// Check parts in order of importance. Return the first part seen in "visParts" if it is non-NULL. // Check parts in order of importance. Return the first part seen in "visParts" if it is non-NULL.
bool CCSBot::IsVisible(CBasePlayer *pPlayer, bool testFOV, unsigned char *visParts) const bool CCSBot::IsVisible(CBasePlayer *pPlayer, bool testFOV, unsigned char *visParts) const
{ {
#ifdef REGAMEDLL_ADD // REGAMEDLL_FIXES ?
if ((pPlayer->pev->flags & FL_NOTARGET) || (pPlayer->pev->effects & EF_NODRAW))
return false;
#endif
Vector spot = pPlayer->pev->origin; Vector spot = pPlayer->pev->origin;
unsigned char testVisParts = NONE; unsigned char testVisParts = NONE;
@ -714,6 +719,10 @@ CBasePlayer *CCSBot::FindMostDangerousThreat()
if (!pPlayer->IsAlive()) if (!pPlayer->IsAlive())
continue; continue;
#ifdef REGAMEDLL_ADD // REGAMEDLL_FIXES ?
if ((pPlayer->pev->flags & FL_NOTARGET) || (pPlayer->pev->effects & EF_NODRAW))
continue;
#endif
// is it an enemy? // is it an enemy?
if (BotRelationship(pPlayer) == BOT_TEAMMATE) if (BotRelationship(pPlayer) == BOT_TEAMMATE)
{ {