From 816e0209782058b2fb877169b50e423309d81db7 Mon Sep 17 00:00:00 2001 From: jeefo Date: Fri, 16 Feb 2024 22:01:01 +0300 Subject: [PATCH] fix: bots re-pickup same weapon multiple times (fiex #523) fix: ammo pickup isn't working due to mistake between numbers and indexes --- src/botlib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index dd8f57a..8e6d606 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -443,7 +443,7 @@ void Bot::updatePickups () { && (getAmmo (primary.id) > 0.3 * primaryProp.ammo1Max) && !m_isUsingGrenade && !hasShield ()) { - auto weaponType = conf.getWeaponType (primaryWeaponCarried); + auto weaponType = conf.getWeaponType (primary.id); const bool isSniperRifle = weaponType == WeaponType::Sniper; const bool isSubmachine = weaponType == WeaponType::SMG; @@ -512,7 +512,7 @@ void Bot::updatePickups () { if (allowPickup) { // found weapon on ground? - if (pickupType == Pickup::Weapon) { + if (pickupType == Pickup::Weapon || pickupType == Pickup::AmmoAndKits) { if (m_isVIP) { allowPickup = false; }