}
}
- CycleCartridge(uid, component, user);
+ if (!CycleCartridge(uid, component, user))
+ {
+ UpdateAmmoCount(uid);
+ }
if (component.BoltClosed != false)
{
/// <summary>
/// Tries to take ammo from the magazine and insert into the chamber.
/// </summary>
- private void CycleCartridge(EntityUid uid, ChamberMagazineAmmoProviderComponent component, EntityUid? user = null, AppearanceComponent? appearance = null)
+ private bool CycleCartridge(EntityUid uid, ChamberMagazineAmmoProviderComponent component, EntityUid? user = null, AppearanceComponent? appearance = null)
{
// Try to put a new round in if possible.
var magEnt = GetMagazineEntity(uid);
var chambered = GetChamberEntity(uid);
+ var result = false;
// Similar to what takeammo does though that uses an optimised version where
// multiple bullets may be fired in a single tick.
{
UpdateAmmoCount(uid);
}
+
+ result = true;
}
+
+ return result;
}
/// <summary>