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
10 changes: 9 additions & 1 deletion EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,15 @@ public static IEnumerable<CustomItem> UnregisterItems(IEnumerable<Type> targetTy
/// <param name="position">The <see cref="Vector3"/> where the <see cref="CustomItem"/> will be spawned.</param>
/// <param name="previousOwner">The <see cref="Pickup.PreviousOwner"/> of the item. Can be null.</param>
/// <returns>The <see cref="Pickup"/> of the spawned <see cref="CustomItem"/>.</returns>
public virtual Pickup? Spawn(Vector3 position, Player? previousOwner = null) => Spawn(position, Item.Create(Type), previousOwner);
public virtual Pickup? Spawn(Vector3 position, Player? previousOwner = null)
{
Item item = Item.Create(Type);

Pickup? pickup = Spawn(position, item, previousOwner);

UnityEngine.Object.Destroy(item.Base);
return pickup;
}

/// <summary>
/// Spawns the <see cref="CustomItem"/> in a specific position.
Expand Down
Loading