1615 {
1617 return;
1618
1619 float split_quantity_new;
1623 InventoryLocation loc = new InventoryLocation;
1624
1625 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
1626 {
1628 split_quantity_new = stack_max;
1629 else
1631
1632 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
1633 if (new_item)
1634 {
1635 new_item.SetResultOfSplit(true);
1636 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1638 new_item.SetQuantity(split_quantity_new);
1639 }
1640 }
1641 else if (destination_entity && slot_id == -1)
1642 {
1643 if (quantity > stack_max)
1644 split_quantity_new = stack_max;
1645 else
1646 split_quantity_new = quantity;
1647
1649 {
1652 }
1653
1654 if (new_item)
1655 {
1656 new_item.SetResultOfSplit(true);
1657 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1659 new_item.SetQuantity(split_quantity_new);
1660 }
1661 }
1662 else
1663 {
1664 if (stack_max != 0)
1665 {
1667 {
1669 }
1670
1671 if (split_quantity_new == 0)
1672 {
1673 if (!
GetGame().IsMultiplayer())
1674 player.PhysicalPredictiveDropItem(this);
1675 else
1676 player.ServerDropEntity(this);
1677 return;
1678 }
1679
1681
1682 if (new_item)
1683 {
1684 new_item.SetResultOfSplit(true);
1685 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1687 new_item.SetQuantity(stack_max);
1688 new_item.PlaceOnSurface();
1689 }
1690 }
1691 }
1692 }
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)
override bool CanBeSplit()
proto native CGame GetGame()