bot: remove check for weapon switch time by now
This commit is contained in:
parent
e9b181f438
commit
085c4aab85
4 changed files with 20 additions and 26 deletions
|
|
@ -686,7 +686,6 @@ private:
|
|||
float m_changeViewTime {}; // timestamp to change look at while at freezetime
|
||||
float m_breakableTime {}; // breakeble acquired time
|
||||
float m_jumpDistance {}; // last jump distance
|
||||
float m_lastBadWeaponSwitchTime {}; // last time we're switched weapon as it's bad
|
||||
|
||||
bool m_moveToGoal {}; // bot currently moving to goal??
|
||||
bool m_isStuck {}; // bot is stuck
|
||||
|
|
|
|||
|
|
@ -1599,7 +1599,7 @@ void Bot::overrideConditions () {
|
|||
}
|
||||
|
||||
// special handling for reloading
|
||||
if (getCurrentTaskId () == Task::Normal && m_reloadState != Reload::None && m_isReloading && !isInNarrowPlace ()) {
|
||||
if (getCurrentTaskId () == Task::Normal && m_reloadState != Reload::None && m_isReloading && !isDucking () && !isInNarrowPlace ()) {
|
||||
if (m_seeEnemyTime + 2.5f < game.time () && (m_states & (Sense::SuspectEnemy | Sense::HearingEnemy))) {
|
||||
m_moveSpeed = m_fearLevel > m_agressionLevel ? 0.0f : getShiftSpeed ();
|
||||
m_navTimeset = game.time ();
|
||||
|
|
|
|||
|
|
@ -1023,7 +1023,6 @@ bool Bot::isWeaponBadAtDistance (int weaponIndex, float distance) {
|
|||
// to attack our enemy, since current weapon is not very good in this situation.
|
||||
|
||||
// do not switch weapons when crossing the distance line
|
||||
if (m_lastBadWeaponSwitchTime + 3.0f < game.time ()) {
|
||||
auto &info = conf.getWeapons ();
|
||||
|
||||
if (m_difficulty < Difficulty::Normal || !hasSecondaryWeapon ()) {
|
||||
|
|
@ -1042,16 +1041,13 @@ bool Bot::isWeaponBadAtDistance (int weaponIndex, float distance) {
|
|||
|
||||
// better use pistol in short range distances, when using sniper weapons
|
||||
if (weaponType == WeaponType::Sniper && distance < 400.0f) {
|
||||
m_lastBadWeaponSwitchTime = game.time ();
|
||||
return true;
|
||||
}
|
||||
|
||||
// shotguns is too inaccurate at long distances, so weapon is bad
|
||||
if (weaponType == WeaponType::Shotgun && distance > 750.0f) {
|
||||
m_lastBadWeaponSwitchTime = game.time ();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1411,7 +1411,6 @@ void Bot::newRound () {
|
|||
m_combatStrafeDir = Dodge::None;
|
||||
m_fightStyle = Fight::None;
|
||||
m_lastFightStyleCheck = 0.0f;
|
||||
m_lastBadWeaponSwitchTime = 0.0f;
|
||||
|
||||
m_checkWeaponSwitch = true;
|
||||
m_checkKnifeSwitch = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue