Browse Source

Fix male assassins and opfor grunts dropping weapons again (#372)

opfor
Roman Chistokhodov 2 years ago committed by GitHub
parent
commit
341e2767ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      dlls/gearbox/fgrunt.cpp
  2. 34
      dlls/gearbox/massn.cpp

7
dlls/gearbox/fgrunt.cpp

@ -1846,7 +1846,8 @@ void CHFGrunt :: HandleAnimEvent( MonsterEvent_t *pEvent ) @@ -1846,7 +1846,8 @@ void CHFGrunt :: HandleAnimEvent( MonsterEvent_t *pEvent )
{
case HGRUNT_ALLY_AE_DROP_GUN:
{
DropMyItems(FALSE);
if (GetBodygroup(FG_GUN_GROUP) != FG_GUN_NONE)
DropMyItems(FALSE);
SetUse( NULL );
}
break;
@ -3240,7 +3241,7 @@ void CTorch::HandleAnimEvent(MonsterEvent_t *pEvent) @@ -3240,7 +3241,7 @@ void CTorch::HandleAnimEvent(MonsterEvent_t *pEvent)
KillGas ();
break;
case HGRUNT_ALLY_AE_DROP_GUN:
if ( FBitSet( pev->weapons, TORCH_EAGLE ) )
if ( FBitSet( pev->weapons, TORCH_EAGLE ) && pev->body != TORCH_GUN_NONE )
{
DropMyItems(FALSE);
}
@ -3771,7 +3772,7 @@ void CMedic::HandleAnimEvent(MonsterEvent_t *pEvent) @@ -3771,7 +3772,7 @@ void CMedic::HandleAnimEvent(MonsterEvent_t *pEvent)
break;
case HGRUNT_ALLY_AE_DROP_GUN:
if ( FBitSet( pev->weapons, MEDIC_EAGLE | MEDIC_HANDGUN ) )
if ( FBitSet( pev->weapons, MEDIC_EAGLE | MEDIC_HANDGUN ) && GetBodygroup(MEDIC_GUN_GROUP) != MEDIC_GUN_NONE )
{
DropMyItems(FALSE);
}

34
dlls/gearbox/massn.cpp

@ -155,26 +155,28 @@ void CMassn::HandleAnimEvent(MonsterEvent_t *pEvent) @@ -155,26 +155,28 @@ void CMassn::HandleAnimEvent(MonsterEvent_t *pEvent)
Vector vecGunPos;
Vector vecGunAngles;
GetAttachment(0, vecGunPos, vecGunAngles);
if(GetBodygroup(GUN_GROUP) != GUN_NONE)
{
GetAttachment(0, vecGunPos, vecGunAngles);
// switch to body group with no gun.
SetBodygroup(GUN_GROUP, GUN_NONE);
// switch to body group with no gun.
SetBodygroup(GUN_GROUP, GUN_NONE);
// now spawn a gun.
if (FBitSet(pev->weapons, MASSN_SNIPERRIFLE))
{
DropItem("weapon_sniperrifle", vecGunPos, vecGunAngles);
}
else
{
DropItem("weapon_9mmAR", vecGunPos, vecGunAngles);
}
// now spawn a gun.
if (FBitSet(pev->weapons, MASSN_SNIPERRIFLE))
{
DropItem("weapon_sniperrifle", vecGunPos, vecGunAngles);
}
else
{
DropItem("weapon_9mmAR", vecGunPos, vecGunAngles);
}
if (FBitSet(pev->weapons, MASSN_GRENADELAUNCHER))
{
DropItem("ammo_ARgrenades", BodyTarget(pev->origin), vecGunAngles);
if (FBitSet(pev->weapons, MASSN_GRENADELAUNCHER))
{
DropItem("ammo_ARgrenades", BodyTarget(pev->origin), vecGunAngles);
}
}
}
break;

Loading…
Cancel
Save