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

◆ SplitIntoStackMaxToInventoryLocationEx()

ItemBase InventoryItem::SplitIntoStackMaxToInventoryLocationEx ( notnull InventoryLocation dst)
inlineprotected

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

1873 {
1874 float quantity = GetQuantity();
1875 float split_quantity_new;
1876 ItemBase new_item;
1877 if (dst.IsValid())
1878 {
1879 int slot_id = dst.GetSlot();
1880 float stack_max = GetTargetQuantityMax(slot_id);
1881
1882 if (quantity > stack_max)
1883 split_quantity_new = stack_max;
1884 else
1885 split_quantity_new = quantity;
1886
1887 if (ShouldSplitQuantity(split_quantity_new))
1888 {
1889 new_item = ItemBase.Cast(GameInventory.LocationCreateEntity(dst, this.GetType(), ECE_IN_INVENTORY, RF_DEFAULT));
1890
1891 if (new_item)
1892 {
1893 new_item.SetResultOfSplit(true);
1894 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1895 AddQuantity(-split_quantity_new, false, true);
1896 new_item.SetQuantity(split_quantity_new, false, true);
1897 }
1898
1899 return new_item;
1900 }
1901 }
1902
1903 return null;
1904 }
const int ECE_IN_INVENTORY
Определения CentralEconomy.c:36
const int RF_DEFAULT
Определения CentralEconomy.c:65
override float GetQuantity()
Определения ItemBase.c:3508
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:3413
override int GetTargetQuantityMax(int attSlotID=-1)
Определения ItemBase.c:3473
bool ShouldSplitQuantity(float quantity)
Определения ItemBase.c:1613
void ItemBase()
Определения ItemBase.c:148
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().