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
This commit is contained in:
XP-Cagey 2005-04-07 07:22:15 +00:00
parent 59d49b9ba1
commit 694fcad9a8

View file

@ -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 )