Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
improvisedsuppressor.c
Go to the documentation of this file.
1 class ImprovisedSuppressor extends SuppressorBase
2 {
3 
4  const int SLOTS_ARRAY = 9;
5 
6  string slot_names[SLOTS_ARRAY] = { /*"weaponMuzzleAK", */"weaponBayonetAK", "weaponBayonet", "weaponBayonetMosin", "weaponBayonetSKS",/* "weaponMuzzleM4",*/ "weaponMuzzleMosin", /*"pistolMuzzle",*/ "weaponMuzzleMP5" };
7 
8 
9  override bool CanPutAsAttachment( EntityAI parent )
10  {
11  bool cond_state = true;
12  if(!super.CanPutAsAttachment(parent)) {return false;}
13  for ( int i = 0; i < SLOTS_ARRAY ; i++ )
14  {
15  if ( parent.FindAttachmentBySlotName(slot_names[i]) != NULL )
16  {
17  cond_state = false;
18  break;
19  }
20  }
21 
22  if ( cond_state && !parent.IsKindOf("PlateCarrierHolster") && !parent.IsKindOf("PlateCarrierComplete") && !parent.IsKindOf("CarrierHolsterSolo") && !parent.IsKindOf("ChestHolster") )
23  {
24  return true;
25  }
26  return false;
27  }
28 }
SuppressorBase
Definition: groza_barrel_grip.c:1
CanPutAsAttachment
override bool CanPutAsAttachment(EntityAI parent)
Definition: itembase.c:4021
EntityAI
Definition: building.c:5