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

◆ SplitIntoStackMaxHands()

void InventoryItem::SplitIntoStackMaxHands ( PlayerBase player)
inlineprivate

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

1911 {
1912 if (!CanBeSplit())
1913 return;
1914
1915 float quantity = GetQuantity();
1916 float split_quantity_new;
1917 ref ItemBase new_item;
1918 if (player)
1919 {
1920 float stackable = GetTargetQuantityMax();
1921 if (quantity > stackable)
1922 split_quantity_new = stackable;
1923 else
1924 split_quantity_new = quantity;
1925
1926 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.GetType());
1927 new_item = ItemBase.Cast(in_hands);
1928 if (new_item)
1929 {
1930 new_item.SetResultOfSplit(true);
1931 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1932 AddQuantity(-split_quantity_new);
1933 new_item.SetQuantity(split_quantity_new);
1934 }
1935 }
1936 }
class LogManager EntityAI
eBleedingSourceType GetType()
Определения BleedingSource.c:63
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

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