Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_DismantleInventoryItemBaseAction.c
Go to the documentation of this file.
2 {
3  protected SCR_BaseDeployableInventoryItemComponent m_DeployableItemComp;
4 
5  protected RplComponent m_RplComp;
6 
7  //------------------------------------------------------------------------------------------------
8  override bool CanBeShownScript(IEntity user)
9  {
10  if (!m_DeployableItemComp)
11  return false;
12 
13  return m_DeployableItemComp.CanDismantleBeShown(user);
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  override bool CanBePerformedScript(IEntity user)
18  {
19  return true;
20  }
21 
22  //------------------------------------------------------------------------------------------------
23  override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
24  {
25  if (!m_DeployableItemComp || !m_RplComp || m_RplComp.IsProxy())
26  return;
27 
28  m_DeployableItemComp.Dismantle(pUserEntity);
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
33  {
34  IEntity owner = GetOwner();
35  if (!owner)
36  return;
37 
38  m_DeployableItemComp = SCR_BaseDeployableInventoryItemComponent.Cast(owner.FindComponent(SCR_BaseDeployableInventoryItemComponent));
39  m_RplComp = RplComponent.Cast(owner.FindComponent(RplComponent));
40  }
41 }
SCR_DismantleInventoryItemBaseAction
Definition: SCR_DismantleInventoryItemBaseAction.c:1
ScriptedUserAction
Definition: ScriptedUserAction.c:12
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128