Remove some obsolete AppearanceComponent method usages (#13726)

This commit is contained in:
Visne
2023-02-02 17:34:53 +01:00
committed by GitHub
parent 23b90de34d
commit 5a5a3afbb1
111 changed files with 428 additions and 349 deletions

View File

@@ -8,6 +8,8 @@ namespace Content.Client.Mech;
/// <inheritdoc/>
public sealed class MechSystem : SharedMechSystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
/// <inheritdoc/>
public override void Initialize()
{
@@ -26,12 +28,12 @@ public sealed class MechSystem : SharedMechSystem
var state = component.BaseState;
var drawDepth = DrawDepth.Mobs;
if (component.BrokenState != null && args.Component.TryGetData(MechVisuals.Broken, out bool broken) && broken)
if (component.BrokenState != null && _appearance.TryGetData<bool>(uid, MechVisuals.Broken, out var broken, args.Component) && broken)
{
state = component.BrokenState;
drawDepth = DrawDepth.SmallMobs;
}
else if (component.OpenState != null && args.Component.TryGetData(MechVisuals.Open, out bool open) && open)
else if (component.OpenState != null && _appearance.TryGetData<bool>(uid, MechVisuals.Open, out var open, args.Component) && open)
{
state = component.OpenState;
drawDepth = DrawDepth.SmallMobs;