1718 {
1719 float split_quantity_new;
1723 InventoryLocation loc = new InventoryLocation;
1724
1725 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
1726 {
1728 split_quantity_new = stack_max;
1729 else
1731
1733 {
1734 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
1735 if (new_item)
1736 {
1737 new_item.SetResultOfSplit(true);
1738 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1740 new_item.
SetQuantity(split_quantity_new,
false,
true);
1741 }
1742 }
1743 }
1744 else if (destination_entity && slot_id == -1)
1745 {
1746 if (quantity > stack_max)
1747 split_quantity_new = stack_max;
1748 else
1749 split_quantity_new = quantity;
1750
1752 {
1754 {
1757 }
1758
1759 if (new_item)
1760 {
1761 new_item.SetResultOfSplit(true);
1762 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1764 new_item.
SetQuantity(split_quantity_new,
false,
true);
1765 }
1766 }
1767 }
1768 else
1769 {
1770 if (stack_max != 0)
1771 {
1773 {
1775 }
1776
1778 {
1780
1781 if (new_item)
1782 {
1783 new_item.SetResultOfSplit(true);
1784 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1787 new_item.PlaceOnSurface();
1788 }
1789 }
1790 }
1791 }
1792 }
eBleedingSourceType GetType()
const int ECE_PLACE_ON_SURFACE
const int ECE_IN_INVENTORY
FindInventoryLocationType
flags for searching locations in inventory
override float GetQuantity()
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...
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override int GetTargetQuantityMax(int attSlotID=-1)
bool ShouldSplitQuantity(float quantity)
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
proto native CGame GetGame()