Skip to content

Commit

Permalink
More checks to cartridge pop
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Oct 18, 2024
1 parent fef6a36 commit 7a96fa2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ private void HandleObservedShot(ref ShotInfoPacket packet, InventoryController i

ammo.IsUsed = true;

if (magazine != null && magazine is not CylinderMagazineClass && !Weapon.BoltAction)
if (magazine != null && magazine is not CylinderMagazineClass && magazine.Count > 0 && !Weapon.BoltAction)
{
if (Item.HasChambers)
if (Item.HasChambers && magazine.IsAmmoCompatible(Item.Chambers) && Item.Chambers[0].ContainedItem == null)
{
magazine.Cartridges.PopTo(inventoryController, Item.Chambers[0].CreateItemAddress());
}
Expand Down

0 comments on commit 7a96fa2

Please sign in to comment.