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

@@ -6,6 +6,7 @@ namespace Content.Shared.Ensnaring;
public abstract class SharedEnsnareableSystem : EntitySystem
{
[Dependency] private readonly MovementSpeedModifierSystem _speedModifier = default!;
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
public override void Initialize()
{
@@ -25,7 +26,7 @@ public abstract class SharedEnsnareableSystem : EntitySystem
_speedModifier.RefreshMovementSpeedModifiers(uid);
var ev = new EnsnaredChangedEvent(component.IsEnsnared);
RaiseLocalEvent(uid, ev, true);
RaiseLocalEvent(uid, ev);
}
private void OnEnsnareRemove(EntityUid uid, SharedEnsnareableComponent component, EnsnareRemoveEvent args)
@@ -33,7 +34,7 @@ public abstract class SharedEnsnareableSystem : EntitySystem
_speedModifier.RefreshMovementSpeedModifiers(uid);
var ev = new EnsnaredChangedEvent(component.IsEnsnared);
RaiseLocalEvent(uid, ev, true);
RaiseLocalEvent(uid, ev);
}
private void OnEnsnareChange(EntityUid uid, SharedEnsnareableComponent component, EnsnaredChangedEvent args)
@@ -41,12 +42,9 @@ public abstract class SharedEnsnareableSystem : EntitySystem
UpdateAppearance(uid, component);
}
private void UpdateAppearance(EntityUid uid, SharedEnsnareableComponent? component, AppearanceComponent? appearance = null)
private void UpdateAppearance(EntityUid uid, SharedEnsnareableComponent component, AppearanceComponent? appearance = null)
{
if (!Resolve(uid, ref component, ref appearance, false))
return;
appearance.SetData(EnsnareableVisuals.IsEnsnared, component.IsEnsnared);
Appearance.SetData(uid, EnsnareableVisuals.IsEnsnared, component.IsEnsnared, appearance);
}
private void MovementSpeedModify(EntityUid uid, SharedEnsnareableComponent component, RefreshMovementSpeedModifiersEvent args)