DayZ 1.24
Loading...
Searching...
No Matches
SplitItemUtils.c
Go to the documentation of this file.
2{
4 {
6
7 if (!item.GetInventory().CanRemoveEntity() || !player.CanManipulateInventory())
8 return;
9
11 if (target.GetInventory().FindFreeLocationFor(item, FindInventoryLocationType.ANY, il))
12 {
13 if (item_base.GetTargetQuantityMax(il.GetSlot()) >= item_base.GetQuantity())
14 {
15 if (il.GetType() == InventoryLocationType.ATTACHMENT)
16 player.PredictiveTakeEntityToTargetAttachmentEx(il.GetParent(), item, il.GetSlot());
17 else
18 {
20 if (item.GetInventory().GetCurrentInventoryLocation(src))
21 player.PredictiveTakeToDst(src, il);
22
23 }
24 }
25 else
26 item_base.SplitIntoStackMaxClient(il.GetParent(), il.GetSlot());
27 }
28 }
29
31 {
32 ItemBase item_base = ItemBase.Cast(dst.GetItem());
33 int slot = dst.GetSlot();
34
35 if (!dst.GetItem().GetInventory().CanRemoveEntity() || !player.CanManipulateInventory())
36 return;
37
38 float stack_max = item_base.GetTargetQuantityMax(slot);
39
40 if (stack_max >= item_base.GetQuantity())
41 {
43 if (dst.GetItem().GetInventory().GetCurrentInventoryLocation(src))
44 player.PredictiveTakeToDst(src, dst);
45 else
46 Error("TakeIntoCargoEx cannot get src for dst=" + dst.DumpToString());
47 }
48 else
49 item_base.SplitIntoStackMaxToInventoryLocationClient(dst);
50 }
51}
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
InventoryLocation.
static void TakeOrSplitToInventoryLocation(notnull PlayerBase player, notnull InventoryLocation dst)
static void TakeOrSplitToInventory(notnull PlayerBase player, notnull EntityAI target, notnull EntityAI item)
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90