mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 08:07:28 +00:00
* 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>
25 lines
936 B
C#
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;
|
|
}
|
|
}
|