2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-22 01:47:45 +01:00

Use named constants instead of some magical constants in hgrunt code

This commit is contained in:
Roman Chistokhodov 2023-04-24 01:57:25 +03:00
parent b82f524819
commit 00596e94bf

View File

@ -278,7 +278,7 @@ void CHGrunt::GibMonster( void )
Vector vecGunPos; Vector vecGunPos;
Vector vecGunAngles; Vector vecGunAngles;
if( GetBodygroup( 2 ) != 2 ) if( GetBodygroup( GUN_GROUP ) != GUN_NONE )
{ {
// throw a gun if the grunt has one // throw a gun if the grunt has one
GetAttachment( 0, vecGunPos, vecGunAngles ); GetAttachment( 0, vecGunPos, vecGunAngles );
@ -604,7 +604,7 @@ void CHGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir
if( ptr->iHitgroup == 11 ) if( ptr->iHitgroup == 11 )
{ {
// make sure we're wearing one // make sure we're wearing one
if( GetBodygroup( 1 ) == HEAD_GRUNT && ( bitsDamageType & (DMG_BULLET | DMG_SLASH | DMG_BLAST | DMG_CLUB ) ) ) if( GetBodygroup( HEAD_GROUP ) == HEAD_GRUNT && ( bitsDamageType & (DMG_BULLET | DMG_SLASH | DMG_BLAST | DMG_CLUB ) ) )
{ {
// absorb damage // absorb damage
flDamage -= 20; flDamage -= 20;