fix: bots re-pickup same weapon multiple times (fiex #523)

fix: ammo pickup isn't working due to mistake between numbers and indexes
This commit is contained in:
jeefo 2024-02-16 22:01:01 +03:00
commit 816e020978
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED

View file

@ -443,7 +443,7 @@ void Bot::updatePickups () {
&& (getAmmo (primary.id) > 0.3 * primaryProp.ammo1Max) && (getAmmo (primary.id) > 0.3 * primaryProp.ammo1Max)
&& !m_isUsingGrenade && !hasShield ()) { && !m_isUsingGrenade && !hasShield ()) {
auto weaponType = conf.getWeaponType (primaryWeaponCarried); auto weaponType = conf.getWeaponType (primary.id);
const bool isSniperRifle = weaponType == WeaponType::Sniper; const bool isSniperRifle = weaponType == WeaponType::Sniper;
const bool isSubmachine = weaponType == WeaponType::SMG; const bool isSubmachine = weaponType == WeaponType::SMG;
@ -512,7 +512,7 @@ void Bot::updatePickups () {
if (allowPickup) { if (allowPickup) {
// found weapon on ground? // found weapon on ground?
if (pickupType == Pickup::Weapon) { if (pickupType == Pickup::Weapon || pickupType == Pickup::AmmoAndKits) {
if (m_isVIP) { if (m_isVIP) {
allowPickup = false; allowPickup = false;
} }