Skip to content

Commit

Permalink
little fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IRacle1 committed Dec 26, 2024
1 parent e8b468e commit e95f454
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ public override void Spawn()
/// <inheritdoc/>
internal override void ReadItemInfo(Items.Item item)
{
Items.Firearm firearm = (Items.Firearm)item;
MaxAmmo = firearm.PrimaryMagazine.ConstantMaxAmmo;
AmmoDrain = firearm.AmmoDrain;
if (item is Items.Firearm firearm)
{
MaxAmmo = firearm.PrimaryMagazine.ConstantMaxAmmo;
AmmoDrain = firearm.AmmoDrain;
}

base.ReadItemInfo(item);
}

Expand Down

0 comments on commit e95f454

Please sign in to comment.