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

◆ SplitIntoStackMaxCargo()

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

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

1880 {
1881 float quantity = GetQuantity();
1882 float split_quantity_new;
1883 ItemBase new_item;
1884 if (destination_entity)
1885 {
1886 float stackable = GetTargetQuantityMax();
1887 if (quantity > stackable)
1888 split_quantity_new = stackable;
1889 else
1890 split_quantity_new = quantity;
1891
1892 if (ShouldSplitQuantity(split_quantity_new))
1893 {
1894 new_item = ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(this.GetType(), idx, row, col, false));
1895 if (new_item)
1896 {
1897 new_item.SetResultOfSplit(true);
1898 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1899 AddQuantity(-split_quantity_new, false, true);
1900 new_item.SetQuantity(split_quantity_new, false, true);
1901 }
1902 }
1903 }
1904 }
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(), GetQuantity(), GetTargetQuantityMax(), ItemBase(), ItemBase::SetQuantity() и ShouldSplitQuantity().