improvisedsuppressor.c 837 B

12345678910111213141516171819202122232425262728
  1. class ImprovisedSuppressor extends SuppressorBase
  2. {
  3. const int SLOTS_ARRAY = 9;
  4. string slot_names[SLOTS_ARRAY] = { /*"weaponMuzzleAK", */"weaponBayonetAK", "weaponBayonet", "weaponBayonetMosin", "weaponBayonetSKS",/* "weaponMuzzleM4",*/ "weaponMuzzleMosin", /*"pistolMuzzle",*/ "weaponMuzzleMP5" };
  5. override bool CanPutAsAttachment( EntityAI parent )
  6. {
  7. bool cond_state = true;
  8. if(!super.CanPutAsAttachment(parent)) {return false;}
  9. for ( int i = 0; i < SLOTS_ARRAY ; i++ )
  10. {
  11. if ( parent.FindAttachmentBySlotName(slot_names[i]) != NULL )
  12. {
  13. cond_state = false;
  14. break;
  15. }
  16. }
  17. if ( cond_state && !parent.IsKindOf("PlateCarrierHolster") && !parent.IsKindOf("PlateCarrierComplete") && !parent.IsKindOf("CarrierHolsterSolo") && !parent.IsKindOf("ChestHolster") )
  18. {
  19. return true;
  20. }
  21. return false;
  22. }
  23. }