From 4053dca7a9cf999391cbd77224144da207e4540b Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 5 Aug 2022 16:22:03 +0300 Subject: [PATCH] Fix deploy animations sometimes not playing on weapon pickup (#299) --- dlls/player.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/player.cpp b/dlls/player.cpp index e4d7f0fb..234cfb31 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -4609,8 +4609,16 @@ BOOL CBasePlayer::SwitchWeapon( CBasePlayerItem *pWeapon ) } m_pActiveItem = pWeapon; + + CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(pWeapon->GetWeaponPtr()); + if (weapon) + weapon->m_ForceSendAnimations = true; + pWeapon->Deploy(); + if (weapon) + weapon->m_ForceSendAnimations = false; + return TRUE; }