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

◆ SplitIntoStackMaxHands()

void InventoryItem::SplitIntoStackMaxHands ( PlayerBase player)
inlineprotected

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

1931 {
1932 float quantity = GetQuantity();
1933 float split_quantity_new;
1934 ref ItemBase new_item;
1935 if (player)
1936 {
1937 float stackable = GetTargetQuantityMax();
1938 if (quantity > stackable)
1939 split_quantity_new = stackable;
1940 else
1941 split_quantity_new = quantity;
1942
1943 if (ShouldSplitQuantity(split_quantity_new))
1944 {
1945 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.GetType());
1946 new_item = ItemBase.Cast(in_hands);
1947 if (new_item)
1948 {
1949 new_item.SetResultOfSplit(true);
1950 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1951 AddQuantity(-split_quantity_new, false, true);
1952 new_item.SetQuantity(split_quantity_new, false, true);
1953 }
1954 }
1955 }
1956 }
class LogManager EntityAI
eBleedingSourceType GetType()
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

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