Fix crosshair.

This commit is contained in:
Night Owl 2017-07-19 04:11:08 +05:00
parent 946e962f3c
commit a2e4a7ec03

View File

@ -305,6 +305,9 @@ void CHudAmmo::Reset( void )
gHR.Reset(); gHR.Reset();
//VidInit(); //VidInit();
wrect_t nullrc = {};
SetCrosshair( 0, nullrc, 0, 0, 0 ); // reset crosshair
m_pWeapon = NULL; // reset last weapon
} }
int CHudAmmo::VidInit( void ) int CHudAmmo::VidInit( void )
@ -606,22 +609,24 @@ int CHudAmmo::MsgFunc_CurWeapon( const char *pszName, int iSize, void *pbuf )
m_pWeapon = pWeapon; m_pWeapon = pWeapon;
if( gHUD.m_iFOV >= 90 ) if( !( gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL ) ) )
{ {
// normal crosshairs if( gHUD.m_iFOV >= 90 )
if( fOnTarget && m_pWeapon->hAutoaim ) {
SetCrosshair( m_pWeapon->hAutoaim, m_pWeapon->rcAutoaim, 255, 255, 255 ); // normal crosshairs
if( fOnTarget && m_pWeapon->hAutoaim )
SetCrosshair( m_pWeapon->hAutoaim, m_pWeapon->rcAutoaim, 255, 255, 255 );
else
SetCrosshair( m_pWeapon->hCrosshair, m_pWeapon->rcCrosshair, 255, 255, 255 );
}
else else
SetCrosshair( m_pWeapon->hCrosshair, m_pWeapon->rcCrosshair, 255, 255, 255 ); {
} // zoomed crosshairs
else if( fOnTarget && m_pWeapon->hZoomedAutoaim )
{ SetCrosshair( m_pWeapon->hZoomedAutoaim, m_pWeapon->rcZoomedAutoaim, 255, 255, 255 );
// zoomed crosshairs else
if( fOnTarget && m_pWeapon->hZoomedAutoaim ) SetCrosshair( m_pWeapon->hZoomedCrosshair, m_pWeapon->rcZoomedCrosshair, 255, 255, 255 );
SetCrosshair( m_pWeapon->hZoomedAutoaim, m_pWeapon->rcZoomedAutoaim, 255, 255, 255 ); }
else
SetCrosshair( m_pWeapon->hZoomedCrosshair, m_pWeapon->rcZoomedCrosshair, 255, 255, 255 );
} }
m_fFade = 200.0f; //!!! m_fFade = 200.0f; //!!!