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

◆ SplitIntoStackMaxToInventoryLocationEx()

ItemBase InventoryItem::SplitIntoStackMaxToInventoryLocationEx ( notnull InventoryLocation dst)
inlineprivate

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

1823 {
1824 if (!CanBeSplit())
1825 return this;
1826
1827 float quantity = GetQuantity();
1828 float split_quantity_new;
1829 ItemBase new_item;
1830 if (dst.IsValid())
1831 {
1832 int slot_id = dst.GetSlot();
1833 float stack_max = GetTargetQuantityMax(slot_id);
1834
1835 if (quantity > stack_max)
1836 split_quantity_new = stack_max;
1837 else
1838 split_quantity_new = quantity;
1839
1840 new_item = ItemBase.Cast(GameInventory.LocationCreateEntity(dst, this.GetType(), ECE_IN_INVENTORY, RF_DEFAULT));
1841
1842 if (new_item)
1843 {
1844 new_item.SetResultOfSplit(true);
1845 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1846 AddQuantity(-split_quantity_new);
1847 new_item.SetQuantity(split_quantity_new);
1848 }
1849
1850 return new_item;
1851 }
1852
1853 return null;
1854 }
const int ECE_IN_INVENTORY
Определения CentralEconomy.c:36
const int RF_DEFAULT
Определения CentralEconomy.c:65
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
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(), ItemBase::CanBeSplit(), ECE_IN_INVENTORY, GetQuantity(), GetTargetQuantityMax(), ItemBase(), GameInventory::LocationCreateEntity(), RF_DEFAULT и ItemBase::SetQuantity().