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:
20kdc
2021-01-24 08:17:45 +00:00
committed by GitHub
parent 329d599107
commit e53ae365a3
21 changed files with 65 additions and 659 deletions

View File

@@ -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);
}
}
}
}
}
}
}