From a04f47273e5d8700f7691156eb4bd64626b7ecbb Mon Sep 17 00:00:00 2001 From: jeefo Date: Sat, 16 Jan 2016 11:00:40 +0300 Subject: [PATCH] disable by default ultra-mega-high-skill mode pvs check done only for new enemy --- source/basecode.cpp | 2 +- source/combat.cpp | 18 +++++++++--------- source/interface.cpp | 3 +-- source/navigate.cpp | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/source/basecode.cpp b/source/basecode.cpp index 3578c66..2ff9092 100644 --- a/source/basecode.cpp +++ b/source/basecode.cpp @@ -3084,7 +3084,7 @@ void Bot::RunTask_Normal (void) m_prevGoalIndex = -1; // spray logo sometimes if allowed to do so - if (!g_bombPlanted && m_timeLogoSpray < GetWorldTime () && yb_spraypaints.GetBool () && Random.Long (1, 100) < 60 && m_moveSpeed > GetWalkSpeed () && IsEntityNull (m_pickupItem)) + if (m_timeLogoSpray < GetWorldTime () && yb_spraypaints.GetBool () && Random.Long (1, 100) < 60 && m_moveSpeed > GetWalkSpeed () && IsEntityNull (m_pickupItem)) { if (!((g_mapType & MAP_DE) && g_bombPlanted && m_team == TEAM_CF)) PushTask (TASK_SPRAY, TASKPRI_SPRAYLOGO, -1, GetWorldTime () + 1.0f, false); diff --git a/source/combat.cpp b/source/combat.cpp index 5b54f0e..1317eec 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -228,14 +228,6 @@ bool Bot::LookupEnemy (void) float nearestDistance = m_viewDistance; - // setup potentially visible set for this bot - Vector potentialVisibility = EyePosition (); - - if (pev->flags & FL_DUCKING) - potentialVisibility = potentialVisibility + (VEC_HULL_MIN - VEC_DUCK_HULL_MIN); - - byte *pvs = ENGINE_SET_PVS (reinterpret_cast (&potentialVisibility)); - // clear suspected flag if (m_seeEnemyTime + 3.0f < GetWorldTime ()) m_states &= ~STATE_SUSPECT_ENEMY; @@ -257,10 +249,18 @@ bool Bot::LookupEnemy (void) // ignore shielded enemies, while we have real one edict_t *shieldEnemy = NULL; + // setup potentially visible set for this bot + Vector potentialVisibility = EyePosition (); + + if (pev->flags & FL_DUCKING) + potentialVisibility = potentialVisibility + (VEC_HULL_MIN - VEC_DUCK_HULL_MIN); + + byte *pvs = ENGINE_SET_PVS (reinterpret_cast (&potentialVisibility)); + // search the world for players... for (int i = 0; i < GetMaxClients (); i++) { - if (!(g_clients[i].flags & CF_USED) || !(g_clients[i].flags & CF_ALIVE) || (g_clients[i].team == m_team) || (g_clients[i].ent == GetEntity ())) + if (!(g_clients[i].flags & CF_USED) || !(g_clients[i].flags & CF_ALIVE) || g_clients[i].team == m_team || g_clients[i].ent == GetEntity ()) continue; player = g_clients[i].ent; diff --git a/source/interface.cpp b/source/interface.cpp index eeafebb..f291263 100644 --- a/source/interface.cpp +++ b/source/interface.cpp @@ -2177,8 +2177,6 @@ void StartFrame (void) if (g_timePerSecondUpdate < GetWorldTime ()) { - bots.CalculatePingOffsets (); - for (int i = 0; i < GetMaxClients (); i++) { edict_t *player = EntityOfIndex (i + 1); @@ -2206,6 +2204,7 @@ void StartFrame (void) } } } + bots.CalculatePingOffsets (); if (g_bombPlanted) waypoints.SetBombPosition (); diff --git a/source/navigate.cpp b/source/navigate.cpp index 3644e36..2bde14c 100644 --- a/source/navigate.cpp +++ b/source/navigate.cpp @@ -9,7 +9,7 @@ #include -ConVar yb_whose_your_daddy ("yb_whose_your_daddy", "1"); +ConVar yb_whose_your_daddy ("yb_whose_your_daddy", "0"); int Bot::FindGoal (void) {