Logic stuff (#318)
* Logic stuff * Update logic gate appearance on init * Add components * Move port * Fix
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user