CatStation/Content.Server/Revenant/EntitySystems/RevenantOverloadedLightsSystem.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00

30 lines
933 B
C#

using Content.Server.Beam;
using Content.Shared.Revenant.Components;
using Content.Shared.Revenant.EntitySystems;
namespace Content.Server.Revenant.EntitySystems;
/// <summary>
/// This handles...
/// </summary>
public sealed partial class RevenantOverloadedLightsSystem : SharedRevenantOverloadedLightsSystem
{
[Dependency] private BeamSystem _beam = default!;
protected override void OnZap(Entity<RevenantOverloadedLightsComponent> lights)
{
var component = lights.Comp;
if (component.Target == null)
return;
var lxform = Transform(lights);
var txform = Transform(component.Target.Value);
if (!lxform.Coordinates.TryDistance(EntityManager, txform.Coordinates, out var distance))
return;
if (distance > component.ZapRange)
return;
_beam.TryCreateBeam(lights, component.Target.Value, component.ZapBeamEntityId);
}
}