Remove gun .Owners (#14585)

This commit is contained in:
metalgearsloth
2023-03-11 20:08:22 +11:00
committed by GitHub
parent 19f5c403b5
commit 330bb7bb14
18 changed files with 333 additions and 280 deletions

View File

@@ -27,7 +27,8 @@ public sealed partial class GunSystem
/// <param name="component"></param>
private void RefreshControl(EntityUid uid, AmmoCounterComponent? component = null)
{
if (!Resolve(uid, ref component, false)) return;
if (!Resolve(uid, ref component, false))
return;
component.Control?.Dispose();
component.Control = null;
@@ -44,7 +45,8 @@ public sealed partial class GunSystem
private void UpdateAmmoCount(EntityUid uid, AmmoCounterComponent component)
{
if (component.Control == null) return;
if (component.Control == null)
return;
var ev = new UpdateAmmoCounterEvent()
{
@@ -59,7 +61,8 @@ public sealed partial class GunSystem
// Don't use resolves because the method is shared and there's no compref and I'm trying to
// share as much code as possible
if (!Timing.IsFirstTimePredicted ||
!TryComp<AmmoCounterComponent>(uid, out var clientComp)) return;
!TryComp<AmmoCounterComponent>(uid, out var clientComp))
return;
UpdateAmmoCount(uid, clientComp);
}