DayZ 1.24
Loading...
Searching...
No Matches
ActionFoldEntityToSlot.c
Go to the documentation of this file.
2{
4
10
11 override bool HasTarget() { return false; }
12
13 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
14 {
15 EntityAI att = player.GetInventory().FindAttachment(m_SlotID);
16 if (item && att == null)
17 return true;
18 return false;
19 }
20
21 override bool ActionConditionContinue(ActionData action_data) { return true; }
22
27
29 {
30 if (!GetGame().IsMultiplayer())
32
33 ItemBase old_item = action_data.m_MainItem;
34 if (old_item.ConfigIsExisting("ChangeIntoOnAttach"))
35 {
37 string str = old_item.ChangeIntoOnAttach(slot_name);
38 if (str != "")
39 {
41 action_data.m_Player.ServerReplaceItemInHandsWithNewElsewhere(lambda);
42 }
43 }
44 }
45};
46
48{
50 {
52 targetAtt.SetAttachment(player, NULL, slot);
53 OverrideNewLocation(targetAtt);
54 }
55};
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:790
override bool ActionConditionContinue(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnExecuteClient(ActionData action_data)
override void CreateConditionComponents()
override void OnExecuteServer(ActionData action_data)
void FoldBandanaToSlotLambda(EntityAI old_item, string new_item_type, PlayerBase player, int slot)
InventoryLocation.
provides access to slot configuration
static proto native owned string GetSlotName(int id)
converts slot_id to string
const int INVALID
Invalid slot (-1)
proto native CGame GetGame()