Do not react on enemies while climbing ladders instead of jumping from them. #119

Do not test for bad primary weapon, if we have no secondary at all. #119
This commit is contained in:
jeefo 2020-02-04 20:05:32 +03:00
commit d3dff431c6
3 changed files with 10 additions and 13 deletions

View file

@ -2176,7 +2176,7 @@ bool Bot::reactOnEnemy () {
auto lineDist = (m_enemy->v.origin - pev->origin).length ();
auto pathDist = static_cast <float> (graph.getPathDist (ownIndex, enemyIndex));
if (pathDist - lineDist > 112.0f) {
if (pathDist - lineDist > 112.0f || isOnLadder ()) {
m_isEnemyReachable = false;
}
else {
@ -3444,11 +3444,6 @@ void Bot::attackEnemy_ () {
if (!game.isNullEntity (m_enemy)) {
ignoreCollision ();
if (isOnLadder ()) {
pev->button |= IN_JUMP;
clearSearchNodes ();
}
attackMovement ();
if (m_currentWeapon == Weapon::Knife && !m_lastEnemyOrigin.empty ()) {