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,3 +1,4 @@
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Enums;
@@ -29,6 +30,12 @@ namespace Content.Client.Eye.Blinding
}
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;
var playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
if (playerEntity == null)

View File

@@ -1,3 +1,4 @@
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Enums;
@@ -25,6 +26,12 @@ namespace Content.Client.Eye.Blinding
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;
var playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
if (playerEntity == null)