From 45992e30449ac88d65c929609fedebbc7202c9ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Sun, 20 Mar 2022 15:43:05 +0600 Subject: [PATCH] fix: prevent dropping weapons on "Drop C4" command --- src/botlib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index aeb2e1e..411c300 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -5378,11 +5378,11 @@ void Bot::dropWeaponForUser (edict_t *user, bool discardC4) { m_aimFlags |= AimFlags::Entity; m_lookAt = user->v.origin; - if (discardC4) { + if (discardC4 && m_hasC4) { selectWeaponByName ("weapon_c4"); issueCommand ("drop"); } - else { + else if (!discardC4) { selectBestWeapon (); issueCommand ("drop"); }