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

◆ SplitIntoStackMaxCargo()

void SplitIntoStackMaxCargo ( EntityAI destination_entity,
int idx,
int row,
int col )
protected

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

1839 {
1840 float quantity = GetQuantity();
1841 float split_quantity_new;
1842 ItemBase new_item;
1843 if (destination_entity)
1844 {
1845 float stackable = GetTargetQuantityMax();
1846 if (quantity > stackable)
1847 split_quantity_new = stackable;
1848 else
1849 split_quantity_new = quantity;
1850
1851 if (ShouldSplitQuantity(split_quantity_new))
1852 {
1853 new_item = ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(this.GetType(), idx, row, col, false));
1854 if (new_item)
1855 {
1856 new_item.SetResultOfSplit(true);
1857 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1858 AddQuantity(-split_quantity_new, false, true);
1859 new_item.SetQuantity(split_quantity_new, false, true);
1860 }
1861 }
1862 }
1863 }
override float GetQuantity()
Определения ItemBase.c:3486
bool ShouldSplitQuantity(float quantity)
Определения ItemBase.c:1541
override int GetTargetQuantityMax(int attSlotID=-1)
Определения ItemBase.c:3449
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:3389
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfBricks.c:64

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

Используется в SplitIntoStackMaxCargoClient().