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

◆ SplitIntoStackMaxHands()

void SplitIntoStackMaxHands ( PlayerBase player)
protected

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

1890 {
1891 float quantity = GetQuantity();
1892 float split_quantity_new;
1893 ref ItemBase new_item;
1894 if (player)
1895 {
1896 float stackable = GetTargetQuantityMax();
1897 if (quantity > stackable)
1898 split_quantity_new = stackable;
1899 else
1900 split_quantity_new = quantity;
1901
1902 if (ShouldSplitQuantity(split_quantity_new))
1903 {
1904 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.GetType());
1905 new_item = ItemBase.Cast(in_hands);
1906 if (new_item)
1907 {
1908 new_item.SetResultOfSplit(true);
1909 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1910 AddQuantity(-split_quantity_new, false, true);
1911 new_item.SetQuantity(split_quantity_new, false, true);
1912 }
1913 }
1914 }
1915 }
eBleedingSourceType GetType()
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

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

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