Logic stuff (#318)

* Logic stuff

* Update logic gate appearance on init

* Add components

* Move port

* Fix
This commit is contained in:
Aviu00
2023-08-18 09:18:07 +03:00
committed by Aviu00
parent 11cd6c7ac4
commit 7b9a36e4b6
6 changed files with 32 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ using Content.Server.Administration.Logs;
using Content.Server.Clothing.Components;
using Content.Server.DeviceLinking.Events;
using Content.Server.DeviceLinking.Systems;
using Content.Server.DeviceLinking.Components;
using Content.Server.DeviceNetwork;
using Content.Server.DeviceNetwork.Systems;
using Content.Server.Emp;
@@ -79,6 +80,7 @@ namespace Content.Server.Light.EntitySystems
{
light.LightBulbContainer = _containerSystem.EnsureContainer<ContainerSlot>(uid, LightBulbContainer);
_signalSystem.EnsureSinkPorts(uid, light.OnPort, light.OffPort, light.TogglePort);
_signalSystem.EnsureSourcePorts(uid, light.StatusPort); // WD
}
private void OnMapInit(EntityUid uid, PoweredLightComponent light, MapInitEvent args)
@@ -421,6 +423,15 @@ namespace Content.Server.Light.EntitySystems
return;
light.On = !light.On;
// WD START
var data = new NetworkPayload
{
{DeviceNetworkConstants.LogicState, light.On ? SignalState.High : SignalState.Low}
};
_signalSystem.InvokePort(uid, light.StatusPort, data);
// WD END
UpdateLight(uid, light);
}