fix: bots use buttons too extensively
nav: added more cpu-friendly version to check if bot will fall in combat
This commit is contained in:
parent
0873975678
commit
6e09cee0ee
6 changed files with 54 additions and 37 deletions
|
|
@ -1409,7 +1409,7 @@ void Bot::attackMovement () {
|
|||
m_duckTime = game.time () - 1.0f;
|
||||
}
|
||||
|
||||
if (!isInWater () && !isOnLadder () && (m_moveSpeed > 0.0f || m_strafeSpeed >= 0.0f)) {
|
||||
if (!isInWater () && !isOnLadder () && (m_moveSpeed > 0.0f || m_strafeSpeed > 0.0f)) {
|
||||
Vector right, forward;
|
||||
pev->v_angle.angleVectors (&forward, &right, nullptr);
|
||||
|
||||
|
|
@ -1417,7 +1417,7 @@ void Bot::attackMovement () {
|
|||
const auto &side = right * m_strafeSpeed * 0.2f;
|
||||
const auto &spot = pev->origin + front + side + pev->velocity * m_frameInterval;
|
||||
|
||||
if (isDeadlyMove (spot)) {
|
||||
if (isSafeToMove (spot)) {
|
||||
m_strafeSpeed = -m_strafeSpeed;
|
||||
m_moveSpeed = -m_moveSpeed;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue