Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_InspectionUserAction.c
Go to the documentation of this file.
2 {
3  protected BaseWeaponComponent m_WeaponComponent;
4 
5  override bool CanBeShownScript(IEntity user)
6  {
7  if (!m_WeaponComponent)
8  return false;
9 
10  CharacterControllerComponent charComp = CharacterControllerComponent.Cast(user.FindComponent(CharacterControllerComponent));
11  return charComp.GetInspect();
12  }
13 
14  override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
15  {
16  m_WeaponComponent = WeaponComponent.Cast(pOwnerEntity.FindComponent(WeaponComponent));
17  // If there is no WeaponComponent, this might be an attachment. Check up the parent chain
18  if (!m_WeaponComponent)
19  {
20  IEntity parent = pOwnerEntity.GetParent();
21  while (parent)
22  {
23  m_WeaponComponent = WeaponComponent.Cast(parent.FindComponent(WeaponComponent));
24  if (m_WeaponComponent)
25  parent = null;
26  else
27  parent = parent.GetParent();
28  }
29  }
30  }
31 };
SCR_InventoryAction
modded version for to be used with the inventory 2.0
Definition: SCR_InventoryAction.c:3
BaseWeaponComponent
Definition: BaseWeaponComponent.c:12
SCR_InspectionUserAction
Definition: SCR_InspectionUserAction.c:1