Реврайт освещения от дверей на клиент (#375)

* fix: doors no longer light up without power

* rework: rewrite PointLightAirlockSystem on client

* public to private

* cleanup
This commit is contained in:
ThereDrD0
2024-06-22 13:53:37 +03:00
committed by GitHub
parent 22ffee3d18
commit 77696fa638
8 changed files with 105 additions and 131 deletions

View File

@@ -1,24 +0,0 @@
using Content.Server.Power.Components;
using Content.Shared._White.Lighting;
using Content.Shared._White.Lighting.PointLight.Airlock;
using Content.Shared.Doors.Components;
namespace Content.Server._White.Lighting.Pointlight.Airlock;
public sealed class PointLightAirlockSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PointLightAirlockComponent, PowerChangedEvent>(OnPowerChanged);
}
private void OnPowerChanged(EntityUid uid, PointLightAirlockComponent component, PowerChangedEvent args)
{
if (!TryComp<DoorComponent>(uid, out var door))
return;
RaiseLocalEvent(uid, new DoorlightsChangedEvent(args.Powered ? door.State : null, args.Powered), true);
}
}