Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actiondropitem.c
Go to the documentation of this file.
2{
3 override void EndActionComponent()
4 {
5 SetCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
7 }
8}
9
10class ActionDropItem : ActionSingleUseBase
11{
12 string m_ItemName = "";
13
15 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_DROPITEM_HANDS;
17 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_DROPITEM_HANDS;
18 m_CallbackClass = ActionDropItemCB;
19 m_Text = "#drop_item";
20 }
21
23 {
24 m_ConditionItem = new CCINone();
25 m_ConditionTarget = new CCTNone();
26 }
27
28 override typename GetInputType()
29 {
30 return DropActionInput;
31 }
32
33 override bool HasProneException()
34 {
35 return true;
36 }
37
38 override bool CanBeUsedThrowing()
39 {
40 return true;
41 }
42
43 override bool HasTarget()
44 {
45 return false;
46 }
47
48 override bool UseAcknowledgment()
49 {
50 return false;
51 }
52
53 override bool ActionConditionContinue(ActionData action_data)
54 {
55 return true;
56 }
57
58 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
59 {
60 HumanCommandMove hcm = player.GetCommand_Move();
61 if (hcm && hcm.IsChangingStance())
62 return false;
63
64 return player && item;
65 }
66
67 override void OnExecuteServer(ActionData action_data)
68 {
69 if (action_data.m_Player.IsPlacingServer())
70 action_data.m_Player.PlacingCancelServer();
71
72 ClearInventoryReservationEx(action_data);
73
74 if (GetGame().IsServer() && GetGame().IsMultiplayer())
75 {
76 action_data.m_Player.ServerDropEntity(action_data.m_Player.GetItemInHands()); // multiplayer server side
77 }
78 else
79 {
80 PhysicalDropItem(action_data); // single player or multiplayer client side
81 }
82 }
83
84 void PhysicalDropItem(ActionData action_data)
85 {
86 action_data.m_Player.PhysicalPredictiveDropItem(action_data.m_Player.GetItemInHands());
87 }
88}
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool ActionConditionContinue(ActionData action_data)
int m_CommandUIDProne
Definition actionbase.c:32
int m_CommandUID
Definition actionbase.c:31
DetachActionData m_ItemName
override bool HasProneException()
override void OnExecuteServer(ActionData action_data)
void PhysicalDropItem(ActionData action_data)
void ActionDropItem()
override bool CanBeUsedThrowing()
override bool UseAcknowledgment()
override bool HasTarget()
override GetInputType()
void SetCommand(int command_uid)
ActionData m_ActionData
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
proto native CGame GetGame()
const int UA_FINISHED
Definition constants.c:466