mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-11 15:38:12 +00:00
Remove duplicate loop.
This commit is contained in:
parent
9e262a0e14
commit
f614c73318
@ -125,7 +125,7 @@ int CHudHealth::MsgFunc_Damage( const char *pszName, int iSize, void *pbuf )
|
||||
|
||||
vec3_t vecFrom;
|
||||
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
for( int i = 0; i < 3; i++ )
|
||||
vecFrom[i] = READ_COORD();
|
||||
|
||||
UpdateTiles( gHUD.m_flTime, bitsDamage );
|
||||
@ -376,26 +376,15 @@ int CHudHealth::DrawDamage( float flTime )
|
||||
int i, r, g, b, a;
|
||||
DAMAGE_IMAGE *pdmg;
|
||||
|
||||
if (!m_bitsDamage)
|
||||
if( !m_bitsDamage )
|
||||
return 1;
|
||||
|
||||
UnpackRGB( r, g, b, RGB_YELLOWISH );
|
||||
|
||||
a = (int)( fabs( sin( flTime * 2 ) ) * 256.0);
|
||||
a = (int)( fabs( sin( flTime * 2 ) ) * 256.0 );
|
||||
|
||||
ScaleColors( r, g, b, a );
|
||||
|
||||
// Draw all the items
|
||||
for( i = 0; i < NUM_DMG_TYPES; i++ )
|
||||
{
|
||||
if (m_bitsDamage & giDmgFlags[i])
|
||||
{
|
||||
pdmg = &m_dmg[i];
|
||||
SPR_Set(gHUD.GetSprite(m_HUD_dmg_bio + i), r, g, b );
|
||||
SPR_DrawAdditive(0, pdmg->x, pdmg->y, &gHUD.GetSpriteRect(m_HUD_dmg_bio + i));
|
||||
}
|
||||
}
|
||||
|
||||
// check for bits that should be expired
|
||||
for( i = 0; i < NUM_DMG_TYPES; i++ )
|
||||
{
|
||||
@ -403,6 +392,10 @@ int CHudHealth::DrawDamage( float flTime )
|
||||
{
|
||||
pdmg = &m_dmg[i];
|
||||
|
||||
// Draw all the items
|
||||
SPR_Set( gHUD.GetSprite( m_HUD_dmg_bio + i ), r, g, b );
|
||||
SPR_DrawAdditive( 0, pdmg->x, pdmg->y, &gHUD.GetSpriteRect( m_HUD_dmg_bio + i ) );
|
||||
|
||||
pdmg->fExpire = min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire );
|
||||
|
||||
if( pdmg->fExpire <= flTime // when the time has expired
|
||||
|
Loading…
Reference in New Issue
Block a user