Mountea-Framework/MounteaInventoryEquipment

RemoveItemFromInventory

pavlicekdominik opened this issue · 0 comments

Function: RemoveItemFromInventory

Purpose

To remove an entire item slot from the inventory, irrespective of its quantity.

Inputs

  • UInventoryItem ItemToRemove: The item slot to be removed.

Returns

  • bool: Whether the removal was successful.

Description

The function searches for the item in the inventory based on the reference provided and removes the entire slot if found.

Pseudocode

Function RemoveItemFromInventory(ItemToRemove: UInstancedItem*) -> bool:

    // Search for the item in the inventory
    existingItemSlot = SearchSingleItemSlot(FilterConditions based on ItemToRemove)

    // If the item exists in the inventory
    If existingItemSlot is not nullptr:
        // Remove the item slot from the inventory
        Inventory.Remove(existingItemSlot)
        Return true
    Else:
        Return false