Fix overlay bugs (#11406)

This commit is contained in:
Leon Friedrich
2022-09-20 11:49:02 +12:00
committed by GitHub
parent 9d0c5ea170
commit 2cf79bde8f
7 changed files with 57 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
using Content.Shared.Drugs;
using Content.Shared.StatusEffect;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Enums;
@@ -53,6 +54,12 @@ public sealed class RainbowOverlay : Overlay
protected override bool BeforeDraw(in OverlayDrawArgs args)
{
if (!_entityManager.TryGetComponent(_playerManager.LocalPlayer?.ControlledEntity, out EyeComponent? eyeComp))
return false;
if (args.Viewport.Eye != eyeComp.Eye)
return false;
return EffectScale > 0;
}