diff --git a/Exiled.API/Features/Pickups/FirearmPickup.cs b/Exiled.API/Features/Pickups/FirearmPickup.cs
index 64d225fc93..fbeea23486 100644
--- a/Exiled.API/Features/Pickups/FirearmPickup.cs
+++ b/Exiled.API/Features/Pickups/FirearmPickup.cs
@@ -61,10 +61,10 @@ internal FirearmPickup(ItemType type)
public FirearmType FirearmType => Type.GetFirearmType();
///
- /// Gets or sets the of the firearm.
+ /// Gets the of the firearm.
///
[EProperty(category: nameof(FirearmPickup))]
- public AmmoType AmmoType { get; set; }
+ public AmmoType AmmoType { get; private set; }
///
/// Gets or sets a value indicating how many ammo have this .
@@ -103,10 +103,9 @@ internal override void ReadItemInfo(Item item)
{
base.ReadItemInfo(item);
- if (item is Items.Firearm firearm)
+ if (item is Firearm firearm)
{
MaxAmmo = firearm.MaxAmmo;
- AmmoType = firearm.AmmoType;
}
}
@@ -117,14 +116,8 @@ protected override void InitializeProperties(ItemBase itemBase)
if (itemBase is FirearmItem firearm)
{
- MaxAmmo = firearm switch
- {
- AutomaticFirearm autoFirearm => autoFirearm._baseMaxAmmo,
- Revolver => 6,
- Shotgun shotgun => shotgun._ammoCapacity,
- _ => 0
- };
- AmmoType = firearm is AutomaticFirearm automaticFirearm ? automaticFirearm._ammoType.GetAmmoType() : firearm.ItemTypeId.GetAmmoType();
+ MaxAmmo = firearm.GetTotalMaxAmmo();
+ AmmoType = (firearm.Modules.OfType().FirstOrDefault()?.AmmoType ?? ItemType.None).GetAmmoType();
}
}
}