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

◆ SplitIntoStackMaxCargo()

void InventoryItem::SplitIntoStackMaxCargo ( EntityAI destination_entity,
int idx,
int row,
int col )
inlineprivate

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

1857 {
1858 if (!CanBeSplit())
1859 return;
1860
1861 float quantity = GetQuantity();
1862 float split_quantity_new;
1863 ref ItemBase new_item;
1864 if (destination_entity)
1865 {
1866 float stackable = GetTargetQuantityMax();
1867 if (quantity > stackable)
1868 split_quantity_new = stackable;
1869 else
1870 split_quantity_new = quantity;
1871
1872 new_item = ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(this.GetType(), idx, row, col, false));
1873 if (new_item)
1874 {
1875 new_item.SetResultOfSplit(true);
1876 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1877 AddQuantity(-split_quantity_new);
1878 new_item.SetQuantity(split_quantity_new);
1879 }
1880 }
1881 }
override float GetQuantity()
Определения ItemBase.c:3386
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
Определения ItemBase.c:3292
override int GetTargetQuantityMax(int attSlotID=-1)
Определения ItemBase.c:3351
void ItemBase()
Определения ItemBase.c:140
override bool CanBeSplit()
Определения ItemBase.c:1580

Перекрестные ссылки AddQuantity(), ItemBase::CanBeSplit(), GetQuantity(), GetTargetQuantityMax() и ItemBase().