From 694fcad9a863a81d93362fce6982e8d8e8916e9e Mon Sep 17 00:00:00 2001 From: XP-Cagey Date: Thu, 7 Apr 2005 07:22:15 +0000 Subject: [PATCH] Fixed CurWeapon assigned of current weapon pointer in CHudAmmo so that it only switches when WEAPON_IS_CURRENT is set in the flags. git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@38 67975925-1194-0748-b3d5-c16f83f1a3a1 --- main/source/cl_dll/ammo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main/source/cl_dll/ammo.cpp b/main/source/cl_dll/ammo.cpp index 336abf08..c43d4923 100644 --- a/main/source/cl_dll/ammo.cpp +++ b/main/source/cl_dll/ammo.cpp @@ -686,15 +686,16 @@ int CHudAmmo::MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf ) if( pWeapon == NULL ) //don't have the weapon described in our resource list { return 0; } - m_pWeapon = pWeapon; bool bOnTarget = (iState & WEAPON_ON_TARGET) != 0; //used to track autoaim state bool bIsCurrent = (iState & WEAPON_IS_CURRENT) != 0; - m_pWeapon->iEnabled = (iState & WEAPON_IS_ENABLED) != 0 ? TRUE : FALSE; - m_pWeapon->iClip = abs(iClip); + pWeapon->iEnabled = (iState & WEAPON_IS_ENABLED) != 0 ? TRUE : FALSE; + pWeapon->iClip = abs(iClip); if( !bIsCurrent ) { return 1; } + m_pWeapon = pWeapon; + if ( !(gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL )) ) { if ( gHUD.m_iFOV >= 90 )