DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ TakeOrSplitToInventory()

static void SplitItemUtils::TakeOrSplitToInventory ( notnull PlayerBase player,
notnull EntityAI target,
notnull EntityAI item )
inlinestaticprivate

См. определение в файле SplitItemUtils.c строка 3

4 {
5 ItemBase item_base = ItemBase.Cast( item );
6
7 if( !item.GetInventory().CanRemoveEntity() || !player.CanManipulateInventory() )
8 return;
9
10 InventoryLocation il = new InventoryLocation;
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 {
17 player.PredictiveTakeEntityToTargetAttachmentEx(il.GetParent(), item, il.GetSlot());
18 }
19 else
20 {
21 InventoryLocation src = new InventoryLocation;
22 if (item.GetInventory().GetCurrentInventoryLocation(src))
23 player.PredictiveTakeToDst(src, il);
24
25 }
26 }
27 else
28 {
29 item_base.SplitIntoStackMaxClient( il.GetParent(), il.GetSlot() );
30 }
31 }
32 }
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetType()
returns type of InventoryLocation

Перекрестные ссылки InventoryLocation::GetParent(), InventoryLocation::GetSlot() и InventoryLocation::GetType().

Используется в AttachmentCategoriesRow::Combine(), PlayerContainer::OnDropReceivedFromGhostArea(), ClosableContainer::OnDropReceivedFromHeader(), HandsContainer::OnPerformCombination(), Icon::OnPerformCombination(), OnRightPanelDropReceived(), Icon::PerformCombination(), AttachmentCategoriesRow::Select(), ClosableContainer::TakeAsAttachment() и HandsContainer::TakeAsAttachment().