Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dlls/weapons_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ void CBasePlayer::SelectLastItem()
return;
}

auto weapon = m_pLastItem->GetWeaponPtr();

// don't switch if the weapon is out of ammo, otherwise it will break the animations.
if (weapon && !weapon->IsUseable()) return;

ResetAutoaim();

// FIX, this needs to queue them up and delay
Expand All @@ -224,8 +229,6 @@ void CBasePlayer::SelectLastItem()
m_pActiveItem = m_pLastItem;
m_pLastItem = pTemp;

auto weapon = m_pActiveItem->GetWeaponPtr();

if (weapon)
{
weapon->m_ForceSendAnimations = true;
Expand Down