Get rid of the OverlayEffectsComponent stuff (#3010)
* Get rid of the OverlayEffectsComponent stuff because it just ended up creating workarounds for it's bugs, without removing any functionality * Flashes and Flashbangs use the same code now (the Flashable path because it's better)
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.Timing;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
internal sealed class TimedOverlayRemovalSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
foreach (var component in ComponentManager.EntityQuery<ServerOverlayEffectsComponent>())
|
||||
{
|
||||
|
||||
foreach (var overlay in component.ActiveOverlays.ToArray())
|
||||
{
|
||||
if (overlay.TryGetOverlayParameter<TimedOverlayParameter>(out var parameter))
|
||||
{
|
||||
if (parameter.StartedAt + parameter.Length <= _gameTiming.CurTime.TotalMilliseconds)
|
||||
{
|
||||
component.RemoveOverlay(overlay);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user