1672 {
1673 float split_quantity_new;
1678
1680 {
1682 split_quantity_new = stack_max;
1683 else
1685
1687 {
1688 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
1689 if (new_item)
1690 {
1691 new_item.SetResultOfSplit(true);
1692 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1694 new_item.
SetQuantity(split_quantity_new,
false,
true);
1695 }
1696 }
1697 }
1698 else if (destination_entity && slot_id == -1)
1699 {
1700 if (quantity > stack_max)
1701 split_quantity_new = stack_max;
1702 else
1703 split_quantity_new = quantity;
1704
1706 {
1707 GameInventory destinationInventory = destination_entity.GetInventory();
1709 {
1712 }
1713
1714 if (new_item)
1715 {
1716 new_item.SetResultOfSplit(true);
1717 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1719 new_item.
SetQuantity(split_quantity_new,
false,
true);
1720 }
1721 }
1722 }
1723 else
1724 {
1725 if (stack_max != 0)
1726 {
1728 {
1730 }
1731
1733 {
1735
1736 if (new_item)
1737 {
1738 new_item.SetResultOfSplit(true);
1739 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1742 new_item.PlaceOnSurface();
1743 }
1744 }
1745 }
1746 }
1747 }
eBleedingSourceType GetType()
const int ECE_PLACE_ON_SURFACE
const int ECE_IN_INVENTORY
override void SetQuantity()
FindInventoryLocationType
flags for searching locations in inventory
override float GetQuantity()
bool ShouldSplitQuantity(float quantity)
override int GetTargetQuantityMax(int attSlotID=-1)
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...
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
script counterpart to engine's class Inventory
static proto native bool IsSlotIdValid(int slotId)
verifies existence of the slot id
provides access to slot configuration
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)