(Re)Adds open bolt animations for gun sprites (#17219)
Co-authored-by: and_a <and_a@DESKTOP-RJENGIR> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -8,9 +8,6 @@ namespace Content.Shared.Weapons.Ranged.Systems;
|
||||
|
||||
public partial class SharedGunSystem
|
||||
{
|
||||
[Dependency] private readonly INetManager _netMan = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
|
||||
private void InitializeContainer()
|
||||
{
|
||||
SubscribeLocalEvent<ContainerAmmoProviderComponent, TakeAmmoEvent>(OnContainerTakeAmmo);
|
||||
@@ -20,7 +17,7 @@ public partial class SharedGunSystem
|
||||
private void OnContainerTakeAmmo(EntityUid uid, ContainerAmmoProviderComponent component, TakeAmmoEvent args)
|
||||
{
|
||||
component.ProviderUid ??= uid;
|
||||
if (!_container.TryGetContainer(component.ProviderUid.Value, component.Container, out var container))
|
||||
if (!Containers.TryGetContainer(component.ProviderUid.Value, component.Container, out var container))
|
||||
return;
|
||||
|
||||
for (var i = 0; i < args.Shots; i++)
|
||||
@@ -30,7 +27,7 @@ public partial class SharedGunSystem
|
||||
|
||||
var ent = container.ContainedEntities[0];
|
||||
|
||||
if (_netMan.IsServer)
|
||||
if (_netManager.IsServer)
|
||||
container.Remove(ent);
|
||||
|
||||
args.Ammo.Add((ent, EnsureComp<AmmoComponent>(ent)));
|
||||
@@ -40,7 +37,7 @@ public partial class SharedGunSystem
|
||||
private void OnContainerAmmoCount(EntityUid uid, ContainerAmmoProviderComponent component, ref GetAmmoCountEvent args)
|
||||
{
|
||||
component.ProviderUid ??= uid;
|
||||
if (!_container.TryGetContainer(component.ProviderUid.Value, component.Container, out var container))
|
||||
if (!Containers.TryGetContainer(component.ProviderUid.Value, component.Container, out var container))
|
||||
{
|
||||
args.Capacity = 0;
|
||||
args.Count = 0;
|
||||
|
||||
Reference in New Issue
Block a user