Construction warning cleanup (#12256)

This commit is contained in:
Nemanja
2022-10-30 02:48:53 -04:00
committed by GitHub
parent 1a6d084c4d
commit b6135d3be5
47 changed files with 166 additions and 146 deletions

View File

@@ -7,6 +7,8 @@ namespace Content.Server.Construction;
public sealed partial class ConstructionSystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
private void InitializeComputer()
{
SubscribeLocalEvent<ComputerComponent, ComponentInit>(OnCompInit);
@@ -19,10 +21,9 @@ public sealed partial class ConstructionSystem
// Let's ensure the container manager and container are here.
_container.EnsureContainer<Container>(uid, "board");
if (TryComp<ApcPowerReceiverComponent>(uid, out var powerReceiver) &&
TryComp<AppearanceComponent>(uid, out var appearance))
if (TryComp<ApcPowerReceiverComponent>(uid, out var powerReceiver))
{
appearance.SetData(ComputerVisuals.Powered, powerReceiver.Powered);
_appearance.SetData(uid, ComputerVisuals.Powered, powerReceiver.Powered);
}
}
@@ -33,10 +34,7 @@ public sealed partial class ConstructionSystem
private void OnCompPowerChange(EntityUid uid, ComputerComponent component, ref PowerChangedEvent args)
{
if (TryComp<AppearanceComponent>(uid, out var appearance))
{
appearance.SetData(ComputerVisuals.Powered, args.Powered);
}
_appearance.SetData(uid, ComputerVisuals.Powered, args.Powered);
}
/// <summary>