From 932001b59177d0116ffd54465f2fe51bfcbb3901 Mon Sep 17 00:00:00 2001 From: Vaqtincha <37193273+Vaqtincha@users.noreply.github.com> Date: Wed, 31 Oct 2018 00:08:05 +0500 Subject: [PATCH] Bot vision update. * Bots can't see invisible enemies * Bots ignore enemies with flag FL_NOTARGET --- regamedll/dlls/bot/cs_bot_vision.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/regamedll/dlls/bot/cs_bot_vision.cpp b/regamedll/dlls/bot/cs_bot_vision.cpp index 06a8da85..185898c8 100644 --- a/regamedll/dlls/bot/cs_bot_vision.cpp +++ b/regamedll/dlls/bot/cs_bot_vision.cpp @@ -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. 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; unsigned char testVisParts = NONE; @@ -714,6 +719,10 @@ CBasePlayer *CCSBot::FindMostDangerousThreat() if (!pPlayer->IsAlive()) continue; +#ifdef REGAMEDLL_ADD // REGAMEDLL_FIXES ? + if ((pPlayer->pev->flags & FL_NOTARGET) || (pPlayer->pev->effects & EF_NODRAW)) + continue; +#endif // is it an enemy? if (BotRelationship(pPlayer) == BOT_TEAMMATE) {