using System;
using System.Linq;
using Content.Shared.Interaction.Events;
+using Content.Shared.Wieldable;
+using Content.Shared.Wieldable.Components;
using JetBrains.Annotations;
namespace Content.Shared.Weapons.Ranged.Systems;
private void OnRevolverUse(EntityUid uid, RevolverAmmoProviderComponent component, UseInHandEvent args)
{
+ if (args.Handled)
+ return;
+
if (!_useDelay.TryResetDelay(uid))
return;
+ args.Handled = true;
+
Cycle(component);
UpdateAmmoCount(uid, prediction: false);
Dirty(uid, component);
args.Ammo.Add((spawned, EnsureComp<AmmoComponent>(spawned)));
if (cartridge.DeleteOnSpawn)
+ {
+ component.AmmoSlots[index] = null;
component.Chambers[index] = null;
+ }
}
else
{
+ component.AmmoSlots[index] = null;
component.Chambers[index] = null;
args.Ammo.Add((ent.Value, EnsureComp<AmmoComponent>(ent.Value)));
}