Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2907,6 +2907,26 @@ public bool TryAddCandy(CandyKindID candyType)
return true;
}

/// <summary>
/// Removes specific candy from the players <see cref="Scp330"/>.
/// </summary>
/// <param name="candyType">The <see cref="CandyKindID"/> to remove.</param>
/// <param name="removeAll">Remove all candy of that type.</param>
/// <returns><see langword="true"/> if a candy was removed.</returns>
public bool TryRemoveCandу(CandyKindID candyType, bool removeAll = false)
{
foreach (Item item in Items)
{
if (item is not Scp330 bag)
continue;

if (bag.RemoveCandy(candyType, removeAll) > 0)
return true;
}

return false;
}

/// <summary>
/// Resets the player's inventory to the provided list of items, clearing any items it already possess.
/// </summary>
Expand Down