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
14 changes: 2 additions & 12 deletions EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2767,15 +2767,15 @@ public Item AddItem(ItemType itemType)
return AddItem(itemType.GetFirearmType(), null);
}

Item item = Item.Create(itemType);
Item item = Item.Create(itemType, this);

AddItem(item);

return item;
}

/// <summary>
/// Adds an firearm of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
/// Adds a firearm of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
/// </summary>
/// <param name="firearmType">The firearm to be added.</param>
/// <param name="identifiers">The attachments to be added to the item.</param>
Expand All @@ -2790,16 +2790,6 @@ public Item AddItem(FirearmType firearmType, IEnumerable<AttachmentIdentifier> i
firearm.AddAttachment(identifiers);
else if (Preferences is not null && Preferences.TryGetValue(firearmType, out AttachmentIdentifier[] attachments))
firearm.Base.ApplyAttachmentsCode(attachments.GetAttachmentsCode(), true);

// TODO Not finish
/*
FirearmStatusFlags flags = FirearmStatusFlags.MagazineInserted;

if (firearm.Attachments.Any(a => a.Name == AttachmentName.Flashlight))
flags |= FirearmStatusFlags.FlashlightEnabled;

firearm.Base.Status = new FirearmStatus(firearm.MaxAmmo, flags, firearm.Base.GetCurrentAttachmentsCode());
*/
}

AddItem(item);
Expand Down
Loading