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

◆ SplitIntoStackMaxToInventoryLocationEx()

ItemBase SplitIntoStackMaxToInventoryLocationEx ( notnull InventoryLocation dst)
protected

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

1802 {
1803 float quantity = GetQuantity();
1804 float split_quantity_new;
1805 ItemBase new_item;
1806 if (dst.IsValid())
1807 {
1808 int slot_id = dst.GetSlot();
1809 float stack_max = GetTargetQuantityMax(slot_id);
1810
1811 if (quantity > stack_max)
1812 split_quantity_new = stack_max;
1813 else
1814 split_quantity_new = quantity;
1815
1816 if (ShouldSplitQuantity(split_quantity_new))
1817 {
1818 int flag = ECE_IN_INVENTORY;
1819 if (dst.GetType() == InventoryLocationType.GROUND)
1820 flag = ECE_PLACE_ON_SURFACE;
1821 new_item = ItemBase.Cast(GameInventory.LocationCreateEntity(dst, this.GetType(), flag, RF_DEFAULT));
1822
1823 if (new_item)
1824 {
1825 new_item.SetResultOfSplit(true);
1826 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1827 AddQuantity(-split_quantity_new, false, true);
1828 new_item.SetQuantity(split_quantity_new, false, true);
1829 }
1830
1831 return new_item;
1832 }
1833 }
1834
1835 return null;
1836 }
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:38
const int ECE_IN_INVENTORY
Определения CentralEconomy.c:37
const int RF_DEFAULT
Определения CentralEconomy.c:66
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
override float GetQuantity()
Определения ItemBase.c:3486
bool ShouldSplitQuantity(float quantity)
Определения ItemBase.c:1541
override int GetTargetQuantityMax(int attSlotID=-1)
Определения ItemBase.c:3449
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:3389
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location
script counterpart to engine's class Inventory
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfBricks.c:64

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

Используется в SplitIntoStackMaxToInventoryLocation().