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

@@ -6,6 +6,8 @@ namespace Content.Client.Revenant;
public sealed class RevenantSystem : EntitySystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
public override void Initialize()
{
base.Initialize();
@@ -18,15 +20,15 @@ public sealed class RevenantSystem : EntitySystem
if (args.Sprite == null)
return;
if (args.Component.TryGetData(RevenantVisuals.Harvesting, out bool harvesting) && harvesting)
if (_appearance.TryGetData<bool>(uid, RevenantVisuals.Harvesting, out var harvesting, args.Component) && harvesting)
{
args.Sprite.LayerSetState(0, component.HarvestingState);
}
else if (args.Component.TryGetData(RevenantVisuals.Stunned, out bool stunned) && stunned)
else if (_appearance.TryGetData<bool>(uid, RevenantVisuals.Stunned, out var stunned, args.Component) && stunned)
{
args.Sprite.LayerSetState(0, component.StunnedState);
}
else if (args.Component.TryGetData(RevenantVisuals.Corporeal, out bool corporeal))
else if (_appearance.TryGetData<bool>(uid, RevenantVisuals.Corporeal, out var corporeal, args.Component))
{
if (corporeal)
args.Sprite.LayerSetState(0, component.CorporealState);