Files
Delta-v/Content.Client/_DV/Light/LightReactiveSystem.cs
T
William Lemonandpre-commit-ci[bot] 01fe85f77e Fix Flares, Give Skia Spacewalk (#4417)
* Fix various light sources counting as Light, Give Skia spacewalk

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Replace the Ignore Gravity with Jetpack

* Clean up event code + Avoid touching upstream code where possible

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Double cone, strategic untouches

* Additional strategic untouch

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-26 10:03:43 +00:00

25 lines
936 B
C#

using Content.Shared._DV.Light;
using Robust.Client.GameObjects;
namespace Content.Client._DV.Light;
public sealed partial class LightReactiveSystem : SharedLightReactiveSystem
{
[Dependency] private readonly EntityLookupSystem _lookup = default!;
private readonly HashSet<Entity<PointLightComponent>> _lightsInRange = new();
private readonly HashSet<Entity<SharedPointLightComponent>> _validLightsInRange = new();
public override HashSet<Entity<SharedPointLightComponent>> GetLights(EntityUid targetEntity)
{
_lightsInRange.Clear();
_lookup.GetEntitiesInRange(Transform(targetEntity).Coordinates, 10f, _lightsInRange);
_validLightsInRange.Clear();
foreach (var light in _lightsInRange)
{
if (light.Comp.Enabled && !light.Comp.Deleted)
_validLightsInRange.Add(new(light.Owner, light.Comp));
}
return _validLightsInRange;
}
}