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

◆ SplitIntoStackMaxHands()

void InventoryItem::SplitIntoStackMaxHands ( PlayerBase player)
inlineprotected

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

1958 {
1959 float quantity = GetQuantity();
1960 float split_quantity_new;
1961 ref ItemBase new_item;
1962 if (player)
1963 {
1964 float stackable = GetTargetQuantityMax();
1965 if (quantity > stackable)
1966 split_quantity_new = stackable;
1967 else
1968 split_quantity_new = quantity;
1969
1970 if (ShouldSplitQuantity(split_quantity_new))
1971 {
1972 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.GetType());
1973 new_item = ItemBase.Cast(in_hands);
1974 if (new_item)
1975 {
1976 new_item.SetResultOfSplit(true);
1977 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1978 AddQuantity(-split_quantity_new, false, true);
1979 new_item.SetQuantity(split_quantity_new, false, true);
1980 }
1981 }
1982 }
1983 }
class LogManager EntityAI
eBleedingSourceType GetType()
override float GetQuantity()
Определения ItemBase.c:3508
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:3413
override int GetTargetQuantityMax(int attSlotID=-1)
Определения ItemBase.c:3473
bool ShouldSplitQuantity(float quantity)
Определения ItemBase.c:1613
void ItemBase()
Определения ItemBase.c:148

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