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

◆ SplitItemToInventoryLocation()

void InventoryItem::SplitItemToInventoryLocation ( notnull InventoryLocation dst)
inlineprotected

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

1986 {
1987 float quantity = GetQuantity();
1988 float split_quantity_new = Math.Floor(quantity * 0.5);
1989
1990 if (!ShouldSplitQuantity(split_quantity_new))
1991 return;
1992
1993 ItemBase new_item = ItemBase.Cast(GameInventory.LocationCreateEntity(dst, GetType(), ECE_IN_INVENTORY, RF_DEFAULT));
1994
1995 if (new_item)
1996 {
1997 if (new_item.GetQuantityMax() < split_quantity_new)
1998 {
1999 split_quantity_new = new_item.GetQuantityMax();
2000 }
2001
2002 new_item.SetResultOfSplit(true);
2003 MiscGameplayFunctions.TransferItemProperties(this, new_item);
2004
2005 if (dst.IsValid() && dst.GetType() == InventoryLocationType.ATTACHMENT && split_quantity_new > 1)
2006 {
2007 AddQuantity(-1, false, true);
2008 new_item.SetQuantity(1, false, true);
2009 }
2010 else
2011 {
2012 AddQuantity(-split_quantity_new, false, true);
2013 new_item.SetQuantity(split_quantity_new, false, true);
2014 }
2015 }
2016 }
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: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
bool ShouldSplitQuantity(float quantity)
Определения ItemBase.c:1613
void ItemBase()
Определения ItemBase.c:148
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().