Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PickUpItemAction.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
4 {
5  #ifndef DISABLE_INVENTORY
6  //------------------------------------------------------------------------------------------------
7  override protected void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
8  {
9  manager.InsertItem( pOwnerEntity );
10  }
11 
12 
13  //------------------------------------------------------------------------------------------------
14  override bool CanBePerformedScript(IEntity user)
15  {
16  if ( !super.CanBePerformedScript( user ) )
17  return false;
18 
19  auto pInventoryManager = SCR_InventoryStorageManagerComponent.Cast( user.FindComponent( SCR_InventoryStorageManagerComponent ) );
20  if ( !pInventoryManager )
21  return false;
22 
23  pInventoryManager.SetReturnCodeDefault();
24 
25  if ( !pInventoryManager.IsAnimationReady() || !pInventoryManager.CanInsertItem( m_Item.GetOwner(), EStoragePurpose.PURPOSE_DEPOSIT ) )
26  {
27  SetCannotPerformReason( GetReason( pInventoryManager ) );
28  return false;
29  }
30 
31  return true;
32  }
33  #endif
34 };
pInventoryManager
protected SCR_InventoryStorageManagerComponent pInventoryManager
Definition: SCR_UniversalInventoryStorageComponent.c:25
SCR_InventoryAction
modded version for to be used with the inventory 2.0
Definition: SCR_InventoryAction.c:3
m_Item
NewsFeedItem m_Item
Definition: SCR_NewsSubMenu.c:2
SCR_PickUpItemAction
modded version for to be used with the inventory 2.0
Definition: SCR_PickUpItemAction.c:3
EStoragePurpose
EStoragePurpose
Definition: EStoragePurpose.c:12
GetReason
EResourceReason GetReason()
Definition: SCR_ResourceConsumtionResponse.c:44