Check for reload when hiding.

This commit is contained in:
jeefo 2019-06-02 12:19:41 +03:00
commit 2eef246e97
2 changed files with 5 additions and 1 deletions

View file

@ -3728,6 +3728,10 @@ void Bot::hide_ (void) {
pev->button |= m_campButtons;
m_navTimeset = engine.timebase ();
if (!m_isReloading) {
checkReload ();
}
// stop camping if time over or gets hurt by something else than bullets
if (task ()->time < engine.timebase () || m_lastDamageType > 0) {
completeTask ();

View file

@ -2368,7 +2368,7 @@ bool Bot::advanceMovement (void) {
}
// is there a jump waypoint right ahead and do we need to draw out the light weapon ?
if (willJump && m_currentWeapon != WEAPON_KNIFE && m_currentWeapon != WEAPON_SCOUT && !m_isReloading && !usesPistol () && (jumpDistance > 210.0f || (dst.z - 32.0f > src.z && jumpDistance > 150.0f)) && !(m_states & (STATE_SEEING_ENEMY | STATE_SUSPECT_ENEMY))) {
if (willJump && m_currentWeapon != WEAPON_KNIFE && m_currentWeapon != WEAPON_SCOUT && !m_isReloading && !usesPistol () && (jumpDistance > 200.0f || (dst.z - 32.0f > src.z && jumpDistance > 150.0f)) && !(m_states & (STATE_SEEING_ENEMY | STATE_SUSPECT_ENEMY))) {
selectWeaponByName ("weapon_knife"); // draw out the knife if we needed
}