mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-08-26 05:42:00 +00:00
Merge pull request #369 from FreeSlave/hgrunt_fix
Fix hgrunts dropping weapons again. Fix magical constants in hgrunt code.
This commit is contained in:
commit
8d337020b5
@ -278,7 +278,7 @@ void CHGrunt::GibMonster( void )
|
||||
Vector vecGunPos;
|
||||
Vector vecGunAngles;
|
||||
|
||||
if( GetBodygroup( 2 ) != 2 )
|
||||
if( GetBodygroup( GUN_GROUP ) != GUN_NONE )
|
||||
{
|
||||
// throw a gun if the grunt has one
|
||||
GetAttachment( 0, vecGunPos, vecGunAngles );
|
||||
@ -604,7 +604,7 @@ void CHGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir
|
||||
if( ptr->iHitgroup == 11 )
|
||||
{
|
||||
// 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
|
||||
flDamage -= 20;
|
||||
@ -848,6 +848,8 @@ void CHGrunt::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
switch( pEvent->event )
|
||||
{
|
||||
case HGRUNT_AE_DROP_GUN:
|
||||
{
|
||||
if ( GetBodygroup( GUN_GROUP ) != GUN_NONE )
|
||||
{
|
||||
Vector vecGunPos;
|
||||
Vector vecGunAngles;
|
||||
@ -872,6 +874,7 @@ void CHGrunt::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
DropItem( "ammo_ARgrenades", BodyTarget( pev->origin ), vecGunAngles );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HGRUNT_AE_RELOAD:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "hgrunt/gr_reload1.wav", 1, ATTN_NORM );
|
||||
|
Loading…
x
Reference in New Issue
Block a user