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

◆ SplitItemToInventoryLocation()

void InventoryItem::SplitItemToInventoryLocation ( notnull InventoryLocation dst)
inlineprotected

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

1959 {
1960 float quantity = GetQuantity();
1961 float split_quantity_new = Math.Floor(quantity * 0.5);
1962
1963 if (!ShouldSplitQuantity(split_quantity_new))
1964 return;
1965
1966 ItemBase new_item = ItemBase.Cast(GameInventory.LocationCreateEntity(dst, GetType(), ECE_IN_INVENTORY, RF_DEFAULT));
1967
1968 if (new_item)
1969 {
1970 if (new_item.GetQuantityMax() < split_quantity_new)
1971 {
1972 split_quantity_new = new_item.GetQuantityMax();
1973 }
1974
1975 new_item.SetResultOfSplit(true);
1976 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1977
1978 if (dst.IsValid() && dst.GetType() == InventoryLocationType.ATTACHMENT && split_quantity_new > 1)
1979 {
1980 AddQuantity(-1, false, true);
1981 new_item.SetQuantity(1, false, true);
1982 }
1983 else
1984 {
1985 AddQuantity(-split_quantity_new, false, true);
1986 new_item.SetQuantity(split_quantity_new, false, true);
1987 }
1988 }
1989 }
eBleedingSourceType GetType()
const int ECE_IN_INVENTORY
Определения CentralEconomy.c:36
const int RF_DEFAULT
Определения CentralEconomy.c:65
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
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
bool ShouldSplitQuantity(float quantity)
Определения ItemBase.c:1588
void ItemBase()
Определения ItemBase.c:140
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfWoodenPlanks.c:88

Перекрестные ссылки AddQuantity(), ECE_IN_INVENTORY, Math::Floor(), GetQuantity(), GetType(), ItemBase(), GameInventory::LocationCreateEntity(), RF_DEFAULT, ItemBase::SetQuantity() и ShouldSplitQuantity().