Make firelock warning light not require power and add a PointLight (#29024)

* Add a PointLight to firelocks when warnings are active

* Remove power requirement for lights
This commit is contained in:
ShadowCommander
2024-06-15 08:17:16 -07:00
committed by GitHub
parent 71eb4d9178
commit 789453adf0
3 changed files with 20 additions and 10 deletions

View File

@@ -6,9 +6,9 @@ using Content.Server.Power.EntitySystems;
using Content.Server.Shuttles.Components;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Monitor;
using Content.Shared.Doors;
using Content.Shared.Doors.Components;
using Content.Shared.Doors.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Map.Components;
namespace Content.Server.Doors.Systems
@@ -20,6 +20,7 @@ namespace Content.Server.Doors.Systems
[Dependency] private readonly AtmosphereSystem _atmosSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedMapSystem _mapping = default!;
[Dependency] private readonly PointLightSystem _pointLight = default!;
private const int UpdateInterval = 30;
private int _accumulatedTicks;
@@ -53,6 +54,7 @@ namespace Content.Server.Doors.Systems
var airtightQuery = GetEntityQuery<AirtightComponent>();
var appearanceQuery = GetEntityQuery<AppearanceComponent>();
var xformQuery = GetEntityQuery<TransformComponent>();
var pointLightQuery = GetEntityQuery<PointLightComponent>();
var query = EntityQueryEnumerator<FirelockComponent, DoorComponent>();
while (query.MoveNext(out var uid, out var firelock, out var door))
@@ -74,6 +76,11 @@ namespace Content.Server.Doors.Systems
firelock.Temperature = fire;
firelock.Pressure = pressure;
Dirty(uid, firelock);
if (pointLightQuery.TryComp(uid, out var pointLight))
{
_pointLight.SetEnabled(uid, fire | pressure, pointLight);
}
}
}
}