Sniper navbot: Use melee if enemy is near

This commit is contained in:
vicinity-gush8 2021-08-21 18:29:38 +02:00 committed by LightCat
parent 7e48bca697
commit 5abc786fa8

View File

@ -1400,7 +1400,9 @@ static slots getBestSlot(slots active_slot, std::pair<CachedEntity *, float> &ne
if (HasWeapon(LOCAL_E, 56) || HasWeapon(LOCAL_E, 1005) || HasWeapon(LOCAL_E, 1092))
return primary;
if (nearest.second <= 300 && nearest.first->m_iHealth() < 75)
if (nearest.second <= 200)
return melee;
else if (nearest.second <= 300 && nearest.first->m_iHealth() < 75)
return secondary;
else if (nearest.second <= 400 && nearest.first->m_iHealth() < 75)
return active_slot;