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

◆ SplitIntoStackMaxToInventoryLocationEx()

ItemBase InventoryItem::SplitIntoStackMaxToInventoryLocationEx ( notnull InventoryLocation dst)
inlineprotected

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

1846 {
1847 float quantity = GetQuantity();
1848 float split_quantity_new;
1849 ItemBase new_item;
1850 if (dst.IsValid())
1851 {
1852 int slot_id = dst.GetSlot();
1853 float stack_max = GetTargetQuantityMax(slot_id);
1854
1855 if (quantity > stack_max)
1856 split_quantity_new = stack_max;
1857 else
1858 split_quantity_new = quantity;
1859
1860 if (ShouldSplitQuantity(split_quantity_new))
1861 {
1862 new_item = ItemBase.Cast(GameInventory.LocationCreateEntity(dst, this.GetType(), ECE_IN_INVENTORY, RF_DEFAULT));
1863
1864 if (new_item)
1865 {
1866 new_item.SetResultOfSplit(true);
1867 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1868 AddQuantity(-split_quantity_new, false, true);
1869 new_item.SetQuantity(split_quantity_new, false, true);
1870 }
1871
1872 return new_item;
1873 }
1874 }
1875
1876 return null;
1877 }
const int ECE_IN_INVENTORY
Определения CentralEconomy.c:36
const int RF_DEFAULT
Определения CentralEconomy.c:65
override float GetQuantity()
Определения ItemBase.c:3456
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:3362
override int GetTargetQuantityMax(int attSlotID=-1)
Определения ItemBase.c:3421
bool ShouldSplitQuantity(float quantity)
Определения ItemBase.c:1588
void ItemBase()
Определения ItemBase.c:140
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfWoodenPlanks.c:88

Перекрестные ссылки AddQuantity(), ECE_IN_INVENTORY, GetQuantity(), GetTargetQuantityMax(), ItemBase(), GameInventory::LocationCreateEntity(), RF_DEFAULT, ItemBase::SetQuantity() и ShouldSplitQuantity().