Browse Source

Fix Human Grunts dropping weapons again if the game is saved and loaded while the grunt is dying

Same as bc7d6e3c07
fix-cwd-path
Roman Chistokhodov 2 years ago
parent
commit
b82f524819
  1. 37
      dlls/hgrunt.cpp

37
dlls/hgrunt.cpp

@ -849,27 +849,30 @@ void CHGrunt::HandleAnimEvent( MonsterEvent_t *pEvent )
{ {
case HGRUNT_AE_DROP_GUN: case HGRUNT_AE_DROP_GUN:
{ {
Vector vecGunPos; if ( GetBodygroup( GUN_GROUP ) != GUN_NONE )
Vector vecGunAngles; {
Vector vecGunPos;
Vector vecGunAngles;
GetAttachment( 0, vecGunPos, vecGunAngles ); GetAttachment( 0, vecGunPos, vecGunAngles );
// switch to body group with no gun. // switch to body group with no gun.
SetBodygroup( GUN_GROUP, GUN_NONE ); SetBodygroup( GUN_GROUP, GUN_NONE );
// now spawn a gun. // now spawn a gun.
if( FBitSet( pev->weapons, HGRUNT_SHOTGUN ) ) if( FBitSet( pev->weapons, HGRUNT_SHOTGUN ) )
{ {
DropItem( "weapon_shotgun", vecGunPos, vecGunAngles ); DropItem( "weapon_shotgun", vecGunPos, vecGunAngles );
} }
else else
{ {
DropItem( "weapon_9mmAR", vecGunPos, vecGunAngles ); DropItem( "weapon_9mmAR", vecGunPos, vecGunAngles );
} }
if( FBitSet( pev->weapons, HGRUNT_GRENADELAUNCHER ) ) if( FBitSet( pev->weapons, HGRUNT_GRENADELAUNCHER ) )
{ {
DropItem( "ammo_ARgrenades", BodyTarget( pev->origin ), vecGunAngles ); DropItem( "ammo_ARgrenades", BodyTarget( pev->origin ), vecGunAngles );
}
} }
} }
break; break;

Loading…
Cancel
Save