aim: reducec headshot pct, if bot is too highskilled
aim: new cpu-friendly headshot penetration function (yb_shoots_thru_walls 3). still testing nav: use more high range for checking occupied point. nav: if last navigation node is used by someone, assume route ended
This commit is contained in:
parent
53df621dfc
commit
9ddcef2dd4
4 changed files with 76 additions and 13 deletions
|
|
@ -2817,10 +2817,13 @@ void Bot::updateAimDir () {
|
|||
else if (flags & AimFlags::PredictPath) {
|
||||
TraceResult tr {};
|
||||
|
||||
if (m_lastEnemyOrigin.distanceSq (pev->origin) < cr::square (1560.0f) || usesSniper ()) {
|
||||
auto distanceToLastEnemySq = m_lastEnemyOrigin.distanceSq (pev->origin);
|
||||
auto maxDistanceToEnemySq = cr::square (1600.0f);
|
||||
|
||||
if ((distanceToLastEnemySq < maxDistanceToEnemySq || usesSniper ()) && util.isAlive (m_lastEnemy)) {
|
||||
game.testLine (getEyesPos (), m_lastEnemyOrigin, TraceIgnore::Glass, pev->pContainingEntity, &tr);
|
||||
|
||||
if (tr.flFraction >= 0.2f || !tr.fStartSolid || tr.pHit != game.getStartEntity ()) {
|
||||
if (tr.flFraction >= 0.2f || tr.pHit != game.getStartEntity ()) {
|
||||
auto changePredictedEnemy = true;
|
||||
|
||||
if (m_timeNextTracking < game.time () && m_trackingEdict == m_lastEnemy && util.isAlive (m_lastEnemy)) {
|
||||
|
|
@ -2855,6 +2858,9 @@ void Bot::updateAimDir () {
|
|||
}
|
||||
else {
|
||||
m_aimFlags &= ~AimFlags::PredictPath; // forget enemy far away
|
||||
|
||||
if (distanceToLastEnemySq >= maxDistanceToEnemySq)
|
||||
m_lastEnemyOrigin = nullptr;
|
||||
}
|
||||
}
|
||||
else if (flags & AimFlags::Camp) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue