DayZ 1.24
Loading...
Searching...
No Matches
ActionTakeFireplaceFromBarrel Class Reference
Inheritance diagram for ActionTakeFireplaceFromBarrel:
[legend]
Collaboration diagram for ActionTakeFireplaceFromBarrel:
[legend]

Private Member Functions

void ActionTakeFireplaceFromBarrel ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionTakeFireplaceFromBarrel.c.

Constructor & Destructor Documentation

◆ ActionTakeFireplaceFromBarrel()

void ActionTakeFireplaceFromBarrel::ActionTakeFireplaceFromBarrel ( )
inlineprivate

Definition at line 3 of file ActionTakeFireplaceFromBarrel.c.

4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
7 m_Text = "#take_fireplace";
8 }
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, m_StanceMask, and m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionTakeFireplaceFromBarrel::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 10 of file ActionTakeFireplaceFromBarrel.c.

11 {
12 Object target_object = target.GetObject();
13
14 if (target_object && target_object.IsFireplace())
15 {
17
18 //check barrel fireplace state
19 if (fireplace_barrel && fireplace_barrel.IsOpen() && !fireplace_barrel.HasAshes() && !fireplace_barrel.IsBurning())
20 {
21 //check cargo and attachments
22 if (fireplace_barrel.IsCargoEmpty() && fireplace_barrel.GetInventory().AttachmentCount() > 0)
23 return true;
24 }
25 }
26
27 return false;
28 }

◆ OnExecuteServer()

override void ActionTakeFireplaceFromBarrel::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 30 of file ActionTakeFireplaceFromBarrel.c.

31 {
32 Object target_object = action_data.m_Target.GetObject();
34
35 string newTypeName = "Fireplace";
37 bool found = action_data.m_Player.GetInventory().FindFirstFreeLocationForNewEntity(newTypeName, FindInventoryLocationType.ANY, targetIL);
38 if (found)
39 {
40 // allow action only if there is place in inventory
42 lambda.OverrideNewLocation(targetIL);
43 action_data.m_Player.ServerReplaceItemWithNew(lambda);
44 }
45 }
void TakeFireplaceFromBarrelLambda(EntityAI old_item, string new_item_type, PlayerBase player)
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocation.

References TakeFireplaceFromBarrelLambda().


The documentation for this class was generated from the following file: