Fix a bunch of warnings (#10886)

* Fix a bunch of warnings

Also made ensnareable not broadcast as they're only used directed.
Mainly just Get<T> and AppearanceSystem

* buckle too

* fix tests

Co-authored-by: wrexbe <wrexbe@protonmail.com>
This commit is contained in:
metalgearsloth
2022-08-28 13:26:35 +10:00
committed by GitHub
parent cf84c20f68
commit d767ce9585
17 changed files with 75 additions and 79 deletions

View File

@@ -82,10 +82,12 @@ public abstract partial class SharedGunSystem
protected void UpdateBatteryAppearance(EntityUid uid, BatteryAmmoProviderComponent component)
{
if (!TryComp<AppearanceComponent>(uid, out var appearance)) return;
appearance.SetData(AmmoVisuals.HasAmmo, component.Shots != 0);
appearance.SetData(AmmoVisuals.AmmoCount, component.Shots);
appearance.SetData(AmmoVisuals.AmmoMax, component.Capacity);
if (!TryComp<AppearanceComponent>(uid, out var appearance))
return;
Appearance.SetData(uid, AmmoVisuals.HasAmmo, component.Shots != 0, appearance);
Appearance.SetData(uid, AmmoVisuals.AmmoCount, component.Shots, appearance);
Appearance.SetData(uid, AmmoVisuals.AmmoMax, component.Capacity, appearance);
}
private IShootable GetShootable(BatteryAmmoProviderComponent component, EntityCoordinates coordinates)