|
|
@@ -249,6 +249,8 @@ private void OnBallisticTakeAmmo(EntityUid uid, BallisticAmmoProviderComponent c
|
|
|
entity = component.Entities[^1];
|
|
|
|
|
|
args.Ammo.Add((entity, EnsureShootable(entity)));
|
|
|
+ if (!component.AutoCycle) // Goobstation - do not remove spent ammo from the gun it doesn't autocycle
|
|
|
+ break;
|
|
|
component.Entities.RemoveAt(component.Entities.Count - 1);
|
|
|
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
|
|
|
Containers.Remove(entity, component.Container);
|
|
|
@@ -259,6 +261,15 @@ private void OnBallisticTakeAmmo(EntityUid uid, BallisticAmmoProviderComponent c
|
|
|
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.UnspawnedCount));
|
|
|
entity = Spawn(component.Proto, args.Coordinates);
|
|
|
args.Ammo.Add((entity, EnsureShootable(entity)));
|
|
|
+
|
|
|
+ // Goobstation - put spent ammo back in the gun if it doesn't autocycle
|
|
|
+ if (!component.AutoCycle)
|
|
|
+ {
|
|
|
+ component.Entities.Add(entity);
|
|
|
+ Containers.Insert(entity, component.Container);
|
|
|
+ DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
|
|
|
+ }
|
|
|
+ // Goobstation - end
|
|
|
}
|
|
|
}
|
|
|
|